innerHTML and Safari

J

jarintabata

hi i know this is a relatively known issue with safari, but i have yet
to find a really clear explanation of how to deal with it or what
alternative method will accomplish the same thing and work in
safari...

this is my code:

document.getElementById('wire_feed_url').innerHTML = '<a href="<? echo
SITE_ROOT.'rss/?type='; ?>'+newsfeeds.join(',')+'">Subscribe</a>';

any ideas on how to make this work in safari??

thank you!!
 
J

jarintabata

(e-mail address removed) said the following on 1/23/2008 12:34 PM:





IE7
Syntax Error: Line 2 char 1

What that usually means, in IE, is that it isn't finding an external
file. So, IE is inserting a 404 file, the first characters being a
syntax error, and so it blows up.

What version Safari? Mac or PC?

And, why are you using XHTML on the web? IE doesn't even know what it is.

<URL:http://validator.w3.org/check?uri=http://www.thewire.co.uk/ne...>

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ -http://jibbering.com/faq/index.html
Javascript Best Practices -http://www.JavascriptToolbox.com/bestpractices/

hm all good questions i suppose
i inherited this site and am just bug-fixing as per client's
instructions..
the safari i got the complaint about was safari for mac

appalling number of errors via yr validator link..ugh

im curious about yr statement regarding xhtml for the web..can you
explain? i thought xhtml is the direction we're all supposed to head
in..

thanks!
 
D

dave

hm all good questions i suppose
i inherited this site and am just bug-fixing as per client's
instructions..
the safari i got the complaint about was safari for mac

appalling number of errors via yr validator link..ugh

im curious about yr statement regarding xhtml for the web..can you
explain? i thought xhtml is the direction we're all supposed to head
in..

thanks!

The page won't work with any browser. Your javascript includes are
returning back a 404 error and a HTML document, not a .js file
 
S

stannyc

hi i know this is a relatively known issue with safari, but i have yet
to find a really clear explanation of how to deal with it or what
alternative method will accomplish the same thing and work in
safari...

this is my code:

document.getElementById('wire_feed_url').innerHTML = '<a href="<? echo
SITE_ROOT.'rss/?type='; ?>'+newsfeeds.join(',')+'">Subscribe</a>';

any ideas on how to make this work in safari??

thank you!!

InnerHTML is really a Microsoft implementation. Instead, use nodes,
like this:

var aParentItem; // whatever element you want to append the new
anchor to
var newChild = document.createElement("A");
newChild.href = "xxxxxxx";
newChild.appendChild(document.createTextNode("Subscribe"));
aParentItem.appendChild(newChild);
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,430
Messages
2,571,676
Members
48,796
Latest member
Greg L.

Latest Threads

Top