Forum Moderators: open

Message Too Old, No Replies

Anchor tag conflict

anchor tag, NN6.0

         

ControlZ

10:03 am on Jan 27, 2003 (gmt 0)

10+ Year Member



Hello All,

I am using a simple JS file for text. This JS file is called from within a iFrame. Outside the iFrame is the code which references anchor tags within the JS text file. It works great in IE, but for some reason, NN6.0 does not recognize the anchor tags. NN does nothing when the links that are refrenced in the JS are clicked on.

I suspect the problem is within the JS file and has nothing to do with the iFrame. As far as I know, you can't include tags enclosed in " " within JS. It stops the JS from being displayed.

Here's a sample of the JS which again DOES work in IE but does not allow the anchor tag to function in NN 6.0
Notice the anchor tag in the first line.

document.write( "<a name=one><font face='verdana,arial,helvetica' size='1' color='#ffffff'><b>Play The Part</b></font>" );
document.write( "<br><br>It's a sticky issue once again" );
document.write( "<br>Jugglin' 'tween your bizness, family and friends" );

[edited by: korkus2000 at 7:41 pm (utc) on Jan. 27, 2003]
[edit reason] No Site reviews TOS #21 [/edit]

BlobFisk

1:51 pm on Jan 27, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Welcome to WebmasterWorld, ControlZ! Check out Marcia's excellent WebmasterWorld Welcome and Guide to the Basics [webmasterworld.com]. Linking to personal URL's is against the TOS, I'm afraid, and a mod will delink it unless you do first!

I'm afraid that I'm unable to recreate your problem (NN7 and Mozilla 1.0), clicking on the numbered links brings up the appropriate section in the iFrame (unless I'm getting all mixed up and looking at the wrong area!). I do notice that the text in the iFrame changes to red in the hover state - your <a> reference should not be on the whole paragraph, just at the start of the heading - this should eliminate this.

DrDoc

6:24 pm on Jan 27, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



To clearify:

You don't have a closing </a>

And, for your information, you can use quotes, as long as they are "escaped", or mix single/double quotes

Different examples that would work:

1)

document.write("<a href=\"blah.html\">Link text</a>");

2)

document.write('<a href="blah.html">Link text</a>');

3)

document.write('<a href=\'blah.html\'>Link text</a>');

ControlZ

7:29 pm on Jan 27, 2003 (gmt 0)

10+ Year Member



Thanks Doc! What a stupid mistake!

Thanks for the HELP!

Michael

ControlZ

7:30 pm on Jan 27, 2003 (gmt 0)

10+ Year Member



Blob, I didn't know this. WHOOPS, how do I remove the URL?

DrDoc

7:31 pm on Jan 27, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Next to the post, click on "Owner edit"
;)

ControlZ

4:49 am on Jan 28, 2003 (gmt 0)

10+ Year Member



Doc, it's a no go! NN6 still does not recognize the anchor tage. It just does nothing. Here's the JS code which is being called from within an iFrame:

document.write( "<a name='one'></a><font face='verdana,arial,helvetica' size='1' color='#ffffff'><b>Play The Part</b></font>" );
document.write( "<br><br>It's a sticky issue once again" );
document.write( "<br>Jugglin' 'tween your bizness, family and friends" );
document.write( "<br>Lost touch with what is real" );

Here's the coresponding code in HTML outside the iFrame:
<a href="track1.html#one" class="white">1</a>

IE6 works great, but unresponsive in gold old NN6

ControlZ

DrDoc

7:55 am on Jan 28, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Which DOCTYPE are you using?

If it's XHTML Strict you have to use

id
instead of
name

Or, maybe it's just because the code is generated by the script? A bell rings .. But it could also just be a wild guess ..

Anyway, does the code have to be generated on the fly using JavaScript?