Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
Anchor OnClick Problem
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  3 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
CharlesEF  
View profile  
 More options Oct 22 2009, 6:34 am
Newsgroups: microsoft.public.scripting.jscript
From: CharlesEF <Charle...@CEF-Inc.Com>
Date: Wed, 21 Oct 2009 23:34:23 -0700 (PDT)
Local: Thurs, Oct 22 2009 6:34 am
Subject: Anchor OnClick Problem
Hi All,

I have looked at this line for so long I need new eyes.  This is why I
am here.  The below 1 line of code creates anchors (<a>) inside a
<div> element.  I had no problems until I added the onclick action of
window.open(parm1, parm2);, now I get an error telling me that line 1
has a syntax error.  If I remove parm2 from the anchor then a new
window does open with the html file shown and no error message.  But I
need parm2 because I want the html file to display in the "_text"
frame of the HTA.  The line below is 1 long line.

results.innerHTML += '<a id="' + objFilesRS.Fields("ID").Value + '"
title="' + objFilesRS.Fields("Description").Value + '" href=".\\html\
\' + objFilesRS.Fields("Filename").Value + '.html" value=".\\html\\' +
objFilesRS.Fields("Filename").Value + '.html" onclick="window.open
(this.value, "_text");return(false);">' + objFilesRS.Fields
("Filename").Value + '</a><br>';

Can anyone see my problem?

Thanks for any help,

Charles


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Tom Lavedas  
View profile  
 More options Oct 22 2009, 1:54 pm
Newsgroups: microsoft.public.scripting.jscript
From: Tom Lavedas <tglba...@cox.net>
Date: Thu, 22 Oct 2009 06:54:16 -0700 (PDT)
Local: Thurs, Oct 22 2009 1:54 pm
Subject: Re: Anchor OnClick Problem
On Oct 22, 2:34 am, CharlesEF <Charle...@CEF-Inc.Com> wrote:

I see and embedded double quote problem in the part after the
onclick.  That is,

  onclick="window.open(this.value, "_text");return(false);"

has double quotes within a double quoted string.  I think this would
fix that ...

  onclick=\'window.open(this.value, "_text");return(false);\'

by replacing the outer double quotes with single quotes - which need
to be escaped for the original insertion string to compile correctly.
_____________________
Tom Lavedas


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
CharlesEF  
View profile  
 More options Oct 22 2009, 6:12 pm
Newsgroups: microsoft.public.scripting.jscript
From: CharlesEF <Charle...@CEF-Inc.Com>
Date: Thu, 22 Oct 2009 11:12:30 -0700 (PDT)
Local: Thurs, Oct 22 2009 6:12 pm
Subject: Re: Anchor OnClick Problem
On Oct 22, 8:54 am, Tom Lavedas <tglba...@cox.net> wrote:

Hi Tom,

Yes, that fixed the problem.  I tried many things but I never thought
about escaping the single quotes.

Thanks for the help,

Charles


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2010 Google