Results 1 to 2 of 2

Thread: window.onclick accepts only one parameter

Hybrid View

  1. #1
    Join Date
    Dec 2010

    window.onclick accepts only one parameter

    Hi. I'm trying to write a script that opens a formatted html window as instructed here:
    HTML Code:

    His code works right, but when I test it, it works only when I exlude the second and third parameters of window.open().

    Here's what I'm testing:

    <style type="text/css">
    .quasiLink {color:#0000FF; cursor:hand}
    <span class="quasiLink" onClick=javascript:window.open("delegateConnect.html", 
    I'm a Pastor or Church Delegate
    Am I overlooking something?

  2. #2
    Join Date
    Feb 2003
    Michigan, USA
    I suspect the lack of quotes around the onclick attribute are to blame.

    onclick='window.open( ... )'

    Also, the javascript: part is not needed. That's actually a protocol identifier in the case you want to embed JavaScript in the href attribute of the <a> tag. The value of the onclick attribute is assumed to be JavaScript, therefore you don't need to tell the browser to interpret it as JavaScript.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center