DoA
08-07-2009, 08:22 PM
Hi guys,
Here's my code ... what I'm trying to do is use the var url in the window open statement...
// This is our javascript, which will pop up our message
// in an alert box.
function myfunction() {
try {var url = gContextMenu.linkURL} // new FF, other?
catch(e) {
try {var url = gContextMenu.linkURL()} // old FF, SM, other?
catch(e) {var url = String(gContextMenu.link)} // either FF, other?
}
window.open('http://mysite.com/?url=myfunction()','window name')
}
It's also worth noting I've tried the following
function myfunction() {
try {var url = gContextMenu.linkURL} // new FF, other?
catch(e) {
try {var url = gContextMenu.linkURL()} // old FF, SM, other?
catch(e) {var url = String(gContextMenu.link)} // either FF, other?
}
window.open('http://mysite.com/?url=url','window name')
}
and
function myfunction() {
try {var url = gContextMenu.linkURL} // new FF, other?
catch(e) {
try {var url = gContextMenu.linkURL()} // old FF, SM, other?
catch(e) {var url = String(gContextMenu.link)} // either FF, other?
}
window.open('http://mysite.com/?url=var url','window name')
}
Can anyone help? I'm sure it's pretty simple but I'm a javascript newbie!
Here's my code ... what I'm trying to do is use the var url in the window open statement...
// This is our javascript, which will pop up our message
// in an alert box.
function myfunction() {
try {var url = gContextMenu.linkURL} // new FF, other?
catch(e) {
try {var url = gContextMenu.linkURL()} // old FF, SM, other?
catch(e) {var url = String(gContextMenu.link)} // either FF, other?
}
window.open('http://mysite.com/?url=myfunction()','window name')
}
It's also worth noting I've tried the following
function myfunction() {
try {var url = gContextMenu.linkURL} // new FF, other?
catch(e) {
try {var url = gContextMenu.linkURL()} // old FF, SM, other?
catch(e) {var url = String(gContextMenu.link)} // either FF, other?
}
window.open('http://mysite.com/?url=url','window name')
}
and
function myfunction() {
try {var url = gContextMenu.linkURL} // new FF, other?
catch(e) {
try {var url = gContextMenu.linkURL()} // old FF, SM, other?
catch(e) {var url = String(gContextMenu.link)} // either FF, other?
}
window.open('http://mysite.com/?url=var url','window name')
}
Can anyone help? I'm sure it's pretty simple but I'm a javascript newbie!