- Create Account

Normal hyperlinks in a supernote?

Forums > SuperNote > Normal hyperlinks in a supernote?
Author
Message

1) Amy Group: Guests
IP: 67.135.--.--
is it at all possible to have a normal hyperlink inside a supernote? We're using the snb-pinned notedefault supernote load, and in the supernote we have a link for more information (on a different page) as well as a link to a pdf for tips. I've tried adding a target="_blank", but nothing seems to get the hyperlink to work correctly.

My test document is at:
http://www.jocolibrary.org/upload/all/supernoteajax3.html

Thank  you!!

2) Angus Turnbull Group: Moderators
Posts: 4042 Joined: 7 Dec 2003 Location: New Zealand IP: 202.137.--.--
Hmm! The SuperNote script traps mouse click events in MSIE so it might be interfering with some of the events. I will have a play with it when I get home.

- Angus.

3) Amy Group: Guests
IP: 67.135.--.--
Thank you! I've been messing around with using a javascript pop-up script to make the links work, but I'm having a hard time getting the window.open to take the XML URL (I'm pulling data using XML DOM, AJAX-y stuff)... I thought I could be sneaky, but it takes more brain power than I have. :-) I hope there's an easier solution.

4) Amy Group: Guests
IP: 67.135.--.--
I think I have an okay solution. I have it built so it only accepts one type of supernote right now, but I believe it would be easy enough to add the others with an "or" statement. I haven't integrated it fully yet, but it uses a popup window function and pulls all the links out of the supernote (except the note-close link). Do you have a better solution?
http://www.jocolibrary.org/upload/all/supernoteajax3c.html

The  un-incorporated version (just an onload right now, but that'll change):
window.onload = function() {
if(!document.getElementsByTagName) return false;
var linkset = document.getElementById("supernote-note-data");
var links = linkset.getElementsByTagName("a");
for (var  i=0; i<links.length; i++) {
if (links[i].className  != "note-close") {
links[i].onclick = function()  {
popUp(this.getAttribute("href"));
return false;
}
}
}
}

And the pop-up:
function popUp(winURL) {
window.open(winURL,"popup","toolbar=0,scrollbars=1,location=0,s tatusbar=0,menubar=0,resizable=1,width=800,height=500");
}

5) Angus Turnbull Group: Moderators
Posts: 4042 Joined: 7 Dec 2003 Location: New Zealand IP: 202.137.--.--
Great to hear! Sorry, I've been a little busy and didn't manage to fully investigate this, but glad that you fixed it :).

-  Angus.

Post a Reply:

You are not logged in, and will be posting anonymously as a guest. If you want to post using an account, please login at the top of this page.