This Message Forum is no longer in use
Please use the new Bravenet Help Forums FOUND HERE
I have a few webrings on my journal. I would like to have it so that when you click a link on the webring that it'll open up a NEW WINDOW. I know that you can use " target=_blank " on most links to do that but I have tried it on the webring code and it's not working.....does anybody know how I can do that?
Where are you adding the "target" attribute. I made a copy of your web ring page, and even tried it from within a
Where do I put it on here?
Yes, it would have been nice if you mentioned that it was only a problem with Bravenet's ring.
Most rings are pretty simple. They have the usual set of text links to navigate. But Bravenet does it a little different. Bravenet creates a table with the images for the buttons in each cell. They then add a "onClick" attribute, that uses a "document.location" reference, to make the table cell active. An example of one button is below.
This makes things difficult to redirect to a new window. The simplest way around it is to change it to something that is easier to redirect. One option is to change the "onClick" attribute to use a "window.open()" reference, like this.
Note that the URL is now enclosed in parentheses. The other thing you could do is change it from the cell being a active area to the button being active link. Then it could be managed like your other web ring links. As you can see in the code below, I just wrapped a standard link structure around the button image.
This is only one of the five buttons in the web ring code. You will need to modify each one of the to operate the same way, if that's what you want.
Can you tell me why this one would be outlined? When I looked at the webring after changing the code it all worked right but this one was outlined in a blue box...don't know why?!
Yes, it's a little hard to notice, but you forgot the link terminator:
< a target="_blank" href="http://pub2.bravenet.com/sitering/nav.php?usernum=163230777&action=list&siteid=44872">
Make sure that all of them have the link terminator.
Well, your code really does work, if you understand what is being done with this code segment. This code is in two pieces:
and
If a visitors browser supports Javascript, and it is enabled, the first part (
I do that kind of thing so automatically, I forget that others may not know how to do this. Plus, the technique is different depending on which browser I am using. Personally I find Netscape fare easier to work with.
In the code you provided there are two links. They look very much alike, but they are not. The Javascript link passes a parameter of f=j;, whereas the other one uses f=l;. These parameters are telling the server what to supply. If you put the second link, with the f=l; parameter, in a web browser, you will simply be taken to a web page with a bunch of web rings on it. You could then easily view the source code, using the view menu or the right mouse button, and extract the code.
But the first link will behave differently, depending on your browser. If you put the first link in a IE browser window, you will be prompted to save the file. If you save the file, with a ".js" extension, and then open it up in a text editor, you will see that it is some Javascript code. All of the web ring code is stuffed in one big "document.write" command (one line 2,000 characters long). If you did the same thing with Netscape, it would just display the Javascript in the browser window, and you could do a "Save As".
Now you have a choice. You can strip out all of the Javascript or use the file as-is. If you know what characters are for Javascript and what is HTML, it's a pretty simple job to recover the HTML code. But, using it as-is, is even easier. As long as you have the file open in a text editor, you can modify the "target" attributes to do what you want. Then, save the changes and upload it to your web site. In the original web ring code, you can just change the "src" reference in the
Now the web ring code will respond the way you want it to.
Yes I use IE so I won't bother (at the moment) to try and mess around with that I suppose. I will bookmark this and come back to it later on. I'm always interested in learning something new and I know nothing about java script. Now I have to tackle the webring codes on my MAIN page of my website which oughta be interesting to say the least. Thank-you so very much for all your time and patience with lil ol me Martin. Take care and beware I will be back