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
    Mar 2009
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Adding a rel tag to javascript

    I have a script which opens an HTML page and passes the current URL to a form on the page. I'm also using RokBox, which open a window as an overlay on the current page rather than as a popup. It is triggered by adding rel="rokbox" to any link. For instance, the following link opens moreinfo.htm using RokBox:

    Code:
    <a rel="rokbox" href="/modules/mod_S5tellafriend/moreinfo.htm">More Info</a>
    Problem is the link doesn't pass the URL. The following code passes the URL but doesn't trigger RokBox:

    Code:
    <input type="button" class="button" value="MORE INFORMATION" onclick="s5_open_taf_popup()"/>
     
    <script type="text/javascript">
    var s5_taf_parent = window.location;
    function s5_open_taf_popup() {
    window.open('/modules/mod_S5tellafriend/moreinfo.htm','page','toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width=420,height=570,left=50,top=50,titlebar=yes')
    }
    </script>
    Is there a way to add rel="rokbox" to the script? Or maybe pass the URL with the link instead? Thanks!

  • #2
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,862
    Thanks
    160
    Thanked 2,223 Times in 2,210 Posts
    Not sure, but are you trying to achieve the following ?
    Code:
    <script type="text/javascript">
    //var s5_taf_parent = window.location;
    function s5_open_taf_popup(url) {
    window.open(url,'page','toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width=420,height=570,left=50,top=50,titlebar=yes')
    }
    </script>
    Code:
    <a rel="rokbox" href="/modules/mod_S5tellafriend/moreinfo.htm" onclick="s5_open_taf_popup(this.href); return false;">More Info</a>
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • #3
    New to the CF scene
    Join Date
    Mar 2009
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    No dice. That trigged both the javascript window.open and the rel=rokbox link. Both worked as before but I'm trying to combine them somehow. Its almost like using a link instead an input button clears the URL (which would make sense). I think I need to figure out how to pass the URL to the next page, which I'm sure is over my head. Or I need to somehow trigger rokbox in the window.open.

  • #4
    New to the CF scene
    Join Date
    May 2010
    Location
    Argentina
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I solve your problem, but my english is not very good, so if u r still interested in an answer, add me to skype (smariano77 - Mariano Soto, Argentina) or to MSN (smariano77@hotmail.com). I will give you the answer and then u can write it properly here.

    Regards,


  •  

    Posting Permissions

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