GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   Question for Code Gurus (https://gfy.com/showthread.php?t=1325620)

2MuchMark 04-02-2020 01:22 PM

Question for Code Gurus
 
Question for Code Gurus

I want to add a link from Site A to Site B, where Site B has a link with an onclick attribute. For example:

Site B has a welcome page. The welcome page contains this link:
<a href="javascript:void(0);" onclick="openLoginModal()">Login</a>

I want to create a link from site A, to the welcome page of site B, but that automatically opens the LoginModal as onclick.

I tried something like this:

<a href = "https://example.com" onclick="openLoginModal()">Click here</a>

But it doesn't work.

Any help is appreciated. Thanks!

k0nr4d 04-02-2020 01:32 PM

Simplest way is like this:

Link to https://siteb.com/?modal=true
and then on siteb page

<?php if($_GET['modal']) { ?>
<script>
openLoginModal();
</script>
<? } ?>

If it's a smarty template you have to do it with JS

AzteK 04-02-2020 01:33 PM

This doesn't make any sense to me. Why would a link invoke the modal on the welcome page? The destination page should execute it...

k0nr4d 04-02-2020 01:38 PM

Quote:

Originally Posted by AzteK (Post 22639875)
This doesn't make any sense to me. Why would a link invoke the modal on the welcome page? The destination page should execute it...

While that is what he wants to do, he's thinking about it the wron gway. He needs to invoke the modal without pressing the button when linking from the other page, not invoke the modal from site A


All times are GMT -7. The time now is 12:50 AM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123