View Full Version : Adding a rel tag to javascript

03-12-2009, 08:12 PM
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:

<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:

<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')

Is there a way to add rel="rokbox" to the script? Or maybe pass the URL with the link instead? Thanks!

03-12-2009, 08:59 PM
Not sure, but are you trying to achieve the following ?

<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=42 0,height=570,left=50,top=50,titlebar=yes')

<a rel="rokbox" href="/modules/mod_S5tellafriend/moreinfo.htm" onclick="s5_open_taf_popup(this.href); return false;">More Info</a>

03-12-2009, 11:00 PM
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.

05-17-2010, 12:41 AM
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.