...

View Full Version : Launching a modal using a URL from javascript.



rainmanjam
08-26-2008, 09:12 PM
I have spent several hours trying to find a solution to this.

I have a url that is created via javascript:



<a href="javascript:redirectURL();" class="parent">Mark</a> // Here is where I want to insert the code


javascript code

function redirectURL(){
var jsvar1;
var jsvar2;
return "http://www.bla.com/test.aspx?var1="+jsvar1+"&var2="+jsvar2";
}



From this code, I want to launch a modal using the link in the javascript. It looks as if all of the modal apps that I have found need to have the "HRef" populated with the url. Has anyone else run into this issue and found a solution?

binaryWeapon
08-27-2008, 12:10 AM
Check the documentation of whatever modal script you're using. Often there is an advanced usage section where it explains how to manually create a modal using javascript commands, usually something like
var mymodal = new Modal({height:"100px"; width:"100px"; location:"http://www.google.com/"})

Then you could change the location to redirectURL, like ...location: redirectURL(); ...

rainmanjam
08-27-2008, 12:16 AM
Check the documentation of whatever modal script you're using. Often there is an advanced usage section where it explains how to manually create a modal using javascript commands, usually something like
var mymodal = new Modal({height:"100px"; width:"100px"; location:"http://www.google.com/"})

Then you could change the location to redirectURL, like ...location: redirectURL(); ...

Well, I haven't found one yet that works. Any suggestions?

binaryWeapon
08-27-2008, 01:50 AM
Just search around for some lightbox scripts, the most popular type of modal window. I also found this post (http://particletree.com/features/lightbox-gone-wild/) on Particletree to be quite good.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum