Please login or register. Welcome to the Studio, guest!


Quick Links:


newBookmarkLockedFalling

Mancer

Mancer Avatar

**
Official Member

95


April 2007
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.

Chris

Chris Avatar

******
Head Coder

19,519


June 2005
iCell.innerHTML = iCell.innerHTML.replace(/target='?"?_blank'?"?/gi, "target=_'self'");

Use that for the replace line.


Mancer

Mancer Avatar

**
Official Member

95


April 2007
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.

Chris

Chris Avatar

******
Head Coder

19,519


June 2005
Order doesn't matter there.

Have you tried using the link UBBC tag instead of URL?

Mancer

Mancer Avatar

**
Official Member

95


April 2007
you, my friend, receive a check plus. completely forget about he tags. :D
I'm starting this revolution: This is my sandbox, y'all just dig'n.

Chris

Chris Avatar

******
Head Coder

19,519


June 2005
I had forgotten too actually. :P But hey, I remembered eventually!

dev7
Guest
What exactly does the link tag do?

Mithras

Mithras Avatar

****
Studio Member

600


July 2006
dev7 said:
What exactly does the link tag do?


Opens the link in the same window, whereas url opens the link in a new window.


Support Rob Scuderi, the #1 Penguins Defender!

lucifer said:
"Behold: me! I have authority in this building."

newBookmarkLockedFalling