Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Reply
Simple dynamic content not displaying in Safari??
Old 07-30-2010, 08:21 AM Simple dynamic content not displaying in Safari??
Junior Talker

Posts: 2
Name: Dave Clarke
Trades: 0
Hi,

I am no expert but i have started using this code to prevent the information it displays from appearing in my site search and remaining private. Firefox displays it perfectly, but Safari 5 on OSX shows absolutely nothing? how can this be?

Is there something i can add so it will display in all browsers??

Any help on this will be much appreciated.

Thanks in advance.

Dave.

Code below ------------------------------------------

HTML Code:
<div id="dynContent"></div>
<script type="text/javascript">// <![CDATA[
  var dyn = document.getElementById('dynContent');
  dyn.innerHTML = 


<table style="width: 480px;" align="left" border="0" cellpadding="3">
<tbody>


<tr>
<td style="text-align: center;">
<p><span style="font-family: helvetica; font-size: x-large;"><span style="color: #ff0066;"><strong>Main Title Goes Here</strong></span><br /></span><span style="font-family: helvetica; font-size: x-large;"><span style="font-size: small; color: #808080;"></span></span></p>
</td>
</tr>


<tr>
<td style="text-align: center;"><span style="font-family: helvetica; font-size: medium;"><span style="color: #808080;">Other: <span style="color: #000000;">Details</span><br /></span></span></td>
</tr>




</tbody>
</table>
// ]]></script>

Last edited by chrishirst; 07-30-2010 at 08:41 AM..
24davo is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 07-30-2010, 08:41 AM Re: Simple dynamic content not displaying in Safari??
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,505
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Surprised it works in anything!

Strings need to be enclosed in quotemarks.
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 07-31-2010, 12:57 PM Re: Simple dynamic content not displaying in Safari??
Junior Talker

Posts: 2
Name: Dave Clarke
Trades: 0
Thanks for the response,

When i add the quote marks it doesn't seem to work at all so i went with what had worked.

I've probably got it messed up somewhere and can't see it.

What would you suggest? What seems to be missing or where was i supposed to put the quote marks?

Thanks again

Last edited by 24davo; 07-31-2010 at 12:58 PM..
24davo is offline
Reply With Quote
View Public Profile
 
Old 07-31-2010, 03:56 PM Re: Simple dynamic content not displaying in Safari??
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,505
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
You did "escape" the double quotes in the string?
eg:
HTML Code:
  dyn.innerHTML = 


'<table style=\"width: 480px;\" align=\"left\" border=\"0\" cellpadding=\"3\">
<tbody>


<tr>
<td style=\"text-align: center;\">
<p><span style=\"font-family: helvetica; font-size: x-large;\"><span style=\"color: #ff0066;\"><strong>Main Title Goes Here</strong></span><br /></span><span style=\"font-family: helvetica; font-size: x-large;\"><span style=\"font-size: small; color: #808080;\"></span></span></p>
....
<tr>


</tbody>
</table>'
A "better" way is to use DOM methods to insert the elements.
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Reply     « Reply to Simple dynamic content not displaying in Safari??
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.13853 seconds with 12 queries