Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Aug 2008
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Launching a modal using a URL from javascript.

    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?

  • #2
    Regular Coder
    Join Date
    Sep 2007
    Location
    AZ, USA
    Posts
    685
    Thanks
    6
    Thanked 46 Times in 46 Posts
    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
    Code:
    var mymodal = new Modal({height:"100px"; width:"100px"; location:"http://www.google.com/"})
    Then you could change the location to redirectURL, like ...location: redirectURL(); ...

  • #3
    New to the CF scene
    Join Date
    Aug 2008
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by binaryWeapon View Post
    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
    Code:
    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?

  • #4
    Regular Coder
    Join Date
    Sep 2007
    Location
    AZ, USA
    Posts
    685
    Thanks
    6
    Thanked 46 Times in 46 Posts
    Just search around for some lightbox scripts, the most popular type of modal window. I also found this post on Particletree to be quite good.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •