Nigel Mercier ® said:
Sorry, sent this before I meant to <rummage: finds glasses>
I realize that I haven't given you kind folks enough info, so here is
the code that I wanted to use on Ebay, but I can't because they don't
allow JS.
<script LANGUAGE="javascript">
function openIt()
{
window.open('
http://homepage.virgin.net/hosting.services/ebay/ppfees.htm',
'fred', config='height=180,width=400');
}
</SCRIPT>
<a href="javascript
nClick=openIt()">Click here to open a
calculator</a>
Your JavaScript is completely wrong, and that's most likely the reason it's
not working on eBay.
window.open() takes 3 parameters, the first is the URL, the second is the name
of the window, the 3rd is a comma-delimited list of attributes to be applied
to the window. The phrase "config=" shouldn't appear anywhere in an open()
method invocation.
I'd suggest before attempting to use JavaScript on a service like eBay, you
actually learn the basics of scripting first, either locally or on the
webspace provided by your ISP.
<script type="text/javascript">
function openIt(url, name, attributes) {
window.open(url, name, attributes);
}
</script>
<a href="
http://host/path/file.html"
target="fred"
onclick="openIt(this.href, this.name, 'height=180,width=400'); return
false;">Link</a>
Now, if JavaScript is enabled you will get a window with your choice of width
and height. If JavaScript is disabled or filtered by a proxy, the link will
(should) still produce a new window with your URL loaded into it. I say
"should" because some browsers can be configured so that even TARGET="..." is
ignored and the link is opened in the current browser window.
By the way, I don't believe eBay does anything to script embedded in ads. I
remember a recent eBay posting that used script to open your CDROM drive door,
so I don't believe they filter it (although since that incident they may have
started filtering it). Regardless, I /know/ your script contained errors, so
that's the first place to start.
--
| Grant Wagner <
[email protected]>
* Client-side Javascript and Netscape 4 DOM Reference available at:
*
http://devedge.netscape.com/library/manuals/2000/javascript/1.3/reference/frames.html
* Internet Explorer DOM Reference available at:
*
http://msdn.microsoft.com/workshop/author/dhtml/reference/dhtml_reference_entry.asp
* Netscape 6/7 DOM Reference available at:
*
http://www.mozilla.org/docs/dom/domref/
* Tips for upgrading JavaScript for Netscape 7 / Mozilla
*
http://www.mozilla.org/docs/web-developer/upgrade_2.html