|
OK so I've already mentioned that links created on a board cells using UBB (i.e. Sub-Boards:) open a new window as opposed to just loading the link in the parent/self window. Here's the short piece I scratched down and it doesn't seem to be working... any pointers? <script type="text/javascript"> // SUB-UBB LINK SYSTEM var iCell = document.getElementsByTagName("td"); if(location.href.match(/board=/i) && !location.href.match(/action=/i)){ for(i=0;i<iCell.length;i++){ if(iCell[i].innerHTML.match(/Sub-Boards/i)){ iCell[i].innerHTML = iCell[i].innerHTML.replace(new RegExp ("target='_blank'", "target=_'self'"));}}} </script>
Any help or pointers are appreciated
|
I'm starting this revolution: This is my sandbox, y'all just dig'n.
|
|
|
|
iCell.innerHTML = iCell.innerHTML.replace(/target='?"?_blank'?"?/gi, "target=_'self'");
Use that for the replace line.
|
|
|
|
|
iCell .innerHTML = iCell.innerHTML.replace(/target='?"?_blank"?'?/gi, "target=_'self'");
had to switch the 2 types of quotes around... but still it's a no go. it opens up the main cell in the _self target and the link clicked in _blank. Can't seem to get a grasp on why.
Last Edit: May 15, 2007 2:56:03 GMT by Mancer
|
I'm starting this revolution: This is my sandbox, y'all just dig'n.
|
|
|
|
Order doesn't matter there.
Have you tried using the link UBBC tag instead of URL?
|
|
|
|
|
you, my friend, receive a check plus. completely forget about he tags.
|
I'm starting this revolution: This is my sandbox, y'all just dig'n.
|
|
|
|
I had forgotten too actually. But hey, I remembered eventually!
|
|
|
|
dev7
Guest
|
What exactly does the link tag do?
|
|
|
|