Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Post New Thread Reply

Register GFY Rules Calendar Mark Forums Read
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 04-02-2020, 01:22 PM   #1
2MuchMark
Videochat Solutions
 
2MuchMark's Avatar
 
Industry Role:
Join Date: Aug 2004
Location: Canada
Posts: 48,887
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!
2MuchMark is online now   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 04-02-2020, 01:32 PM   #2
k0nr4d
Confirmed User
 
k0nr4d's Avatar
 
Industry Role:
Join Date: Aug 2006
Location: Poland
Posts: 9,228
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
k0nr4d is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 04-02-2020, 01:33 PM   #3
AzteK
Confirmed User
 
AzteK's Avatar
 
Industry Role:
Join Date: Feb 2001
Location: Northern Cali, USA
Posts: 3,442
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...
AzteK is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 04-02-2020, 01:38 PM   #4
k0nr4d
Confirmed User
 
k0nr4d's Avatar
 
Industry Role:
Join Date: Aug 2006
Location: Poland
Posts: 9,228
Quote:
Originally Posted by AzteK View Post
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
k0nr4d is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks

Tags
site, link, page, onclick, question, gurus, code, click, appreciated, wecome, attribute, add, login, automatically, create, loginmodal
Thread Tools



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.