Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6

Thread: ) expected

  1. #1
    New Coder
    Join Date
    May 2006
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts

    ) expected

    i am writing string in jsp like below
    Code:
     str = str +
    		    "<a href=\"javascript:setCurrentTreeId('"+this.id+"');" + this.action + "\" id=\"" + this.id + "-anchor\" onfocus=\"\" onblur=\"webFXTreeHandler.blur(this);\" onClick=\"hcl('"+this.action+"');\"" +
    		    (this.target ? " target=\"" + this.target + "\"" : "") +
                "title=\"" + tooltip + "\"" +
    		    ">" + label + "</a></div>";
    its always throwing an javascript error ")" is expected at the onclick function. i don find where i am going wrong. plz suggest me here.
    thanks
    regards.

  • #2
    Senior Coder
    Join Date
    Aug 2002
    Location
    UK
    Posts
    2,789
    Thanks
    2
    Thanked 14 Times in 14 Posts
    Give this a try

    PHP Code:
    str str '<a href="javascript:setCurrentTreeId('+this.id+');" 'this.action +' id=" ' +this.id +' " anchor="" onfocus="" onblur="webFXTreeHandler.blur(this)" onClick="hcl('+this.action+')" ('+this.target +'? target=" '+this.target+'  " :"") title=" 'tooltip +' "> 'label +'</a></div>' 
    Last edited by Mr J; 06-27-2006 at 01:54 PM.
    The silent one.

    The most dangerous thing in the world is an idea.
    The most dangerous person in the world is the one with an idea.

  • #3
    New Coder
    Join Date
    May 2006
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Unhappy same error

    still i am getting the same error!!!!
    regards.

  • #4
    Senior Coder A1ien51's Avatar
    Join Date
    Jun 2002
    Location
    Between DC and Baltimore In a Cave
    Posts
    2,717
    Thanks
    1
    Thanked 94 Times in 88 Posts
    As I said on the other forum, replace the doble quotes with a single quote (apostrophe) ' so it is easier to read or use a variable that stores a double quote.

    Eric
    Tech Author [Ajax In Action, JavaScript: Visual Blueprint]

  • #5
    Senior Coder
    Join Date
    Aug 2002
    Location
    UK
    Posts
    2,789
    Thanks
    2
    Thanked 14 Times in 14 Posts
    Give my previous post another try
    The silent one.

    The most dangerous thing in the world is an idea.
    The most dangerous person in the world is the one with an idea.

  • #6
    New Coder
    Join Date
    May 2006
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts

    syntax error

    whenever i do the replace of ' with " and viceversa , its giving me same error. these lines of code are present in js file inside string variable. anymore suggestions? orelse is it the behaviour of IE version 6 for the use of ' in the code. there is no negative effort on my functionality. its working very fine though its throwing an ) expected exception.
    Last edited by bobz; 06-28-2006 at 05:00 AM.
    regards.


  •  

    Posting Permissions

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