Closed Thread Icon

Topic awaiting preservation: I know, dumb question, but I'm being plagued by a "Unterminated String Constant" Pages that link to <a href="https://ozoneasylum.com/backlink?for=9061" title="Pages that link to Topic awaiting preservation: I know, dumb question, but I&amp;#039;m being plagued by a &amp;quot;Unterminated String Constant&amp;quot;" rel="nofollow" >Topic awaiting preservation: I know, dumb question, but I&#039;m being plagued by a &quot;Unterminated String Constant&quot;\

 
Author Thread
sideout
Bipolar (III) Inmate

From: Hull, Que, Can
Insane since: Feb 2004

posted posted 04-03-2004 01:17

The error is in the tiny weeny bit of code that returns a simple function, it looks something like the following:


<a href=javascript:"onclick='return this_function()'">


What is wrong, I'v tried this a hundred ways and I still get a damn IE error,

Please someone help me with my question that is really undeserving of even being posted here,

Thanks alot, Yours truly stupid guy otherwise known as :

sideout

Slime
Lunatic (VI) Mad Scientist

From: Massachusetts, USA
Insane since: Mar 2000

posted posted 04-03-2004 01:38

Your anchor tag should be of the form:

<a href="..." onclick="...">

I believe the code you may be trying to write is either

<a href="javascript:this_function();">

or

<a href="" onclick="return this_function();">

Both will have similar (if not identical) effects. The second one is preferred, since "javascript:" URL's can be more annoying to users who like to open links in new browser windows.

InI
Paranoid (IV) Mad Scientist

From: Somewhere over the rainbow
Insane since: Mar 2001

posted posted 04-03-2004 14:00

The poster has demanded we remove all his contributions, less he takes legal action.
We have done so.
Now Tyberius Prime expects him to start complaining that we removed his 'free speech' since this message will replace all of his posts, past and future.
Don't follow his example - seek real life help first.

Hugh
Paranoid (IV) Inmate

From: Dublin, Ireland
Insane since: Jul 2000

posted posted 04-03-2004 14:30

>> <a href="..." onclick="javascript:this_function();">
The only use for onclick is to run JS commands or similar, there is no need to prefix this_function() with javascript: only for href, where it assumes a URL by default.

I usually do it like so:
<a href=# onclick=doit()>Its a bit shorter.</a>

smonkey
Paranoid (IV) Inmate

From: Northumberland, England
Insane since: Apr 2003

posted posted 04-03-2004 14:35

InI, you let me down, I thought you knew everything?

you only need the javasccript:; pseudo protocol inside an href, since onclick is already handled by script you don't need to specify it as script you are calling.

Anyway InI, you still know more than me so I won't try to patronise.

Thanks again for all your previous help, really sorry about the email thing, was just very stuck.

<A HREF="http://www.cryokinesis.co.uk" TARGET=_blank>visit

InI
Paranoid (IV) Mad Scientist

From: Somewhere over the rainbow
Insane since: Mar 2001

posted posted 04-03-2004 14:41

The poster has demanded we remove all his contributions, less he takes legal action.
We have done so.
Now Tyberius Prime expects him to start complaining that we removed his 'free speech' since this message will replace all of his posts, past and future.
Don't follow his example - seek real life help first.

smonkey
Paranoid (IV) Inmate

From: Northumberland, England
Insane since: Apr 2003

posted posted 04-03-2004 18:20

VBA you say *devilish grin*

Do you know how to make ActiveX controls for embedding in webpages? Details on this sort of thing are always sketchy or seriously complex - that's microsoft for you.

Principle being that I have some VBA code that extracts icons and I was wondering if it could be wrapped up as an ActiveX control - I know nothing about either

Promise I want email you about it tho

<A HREF="http://www.cryokinesis.co.uk" TARGET=_blank>visit

Slime
Lunatic (VI) Mad Scientist

From: Massachusetts, USA
Insane since: Mar 2000

posted posted 04-03-2004 20:15

It's important to make sure, by the way, that the onclick event returns false, so that the hyperlink is not followed. There are two basic ways to do this:

function my_func() {
...
}
with
<a href="" onclick="my_func(); return false;">

or

function my_func() {
...
return false;
}
with
<a href="" onclick="return my_func();">

I prefer the second one because it's more flexible.

bigredswitch
Obsessive-Compulsive (I) Inmate

From: Silicon Scally, UK
Insane since: Apr 2004

posted posted 04-05-2004 23:18

Do you know how to make ActiveX controls for embedding in webpages?

I can give you some pointers for doing it in MSVC++ if it's any help? Chapter 10 in Beginning ATL 3 COM Programming from Wrox is a good start - basically you use a template wizard to create a Full Control (although a Lite Control is adequate for embedding in IE), then mark the control 'safe for scripting' so you can communicate with JavaScript, and that's it. Or it's at least a start!

Carl.

« BackwardsOnwards »

Show Forum Drop Down Menu