Reply
Simple dynamic content not displaying in Safari??
Old 07-30-2010, 07: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 07:41 AM..
24davo is offline
Reply With Quote
View Public Profile
 
 
When You Register, These Ads Go Away!
Old 07-30-2010, 07:41 AM Re: Simple dynamic content not displaying in Safari??
chrishirst's Avatar
Super Moderator

Posts: 32,316
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
Code Samples | Crowded Nightclub? | Random Ramblings
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 07-31-2010, 11:57 AM 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 11:58 AM..
24davo is offline
Reply With Quote
View Public Profile
 
Old 07-31-2010, 02:56 PM Re: Simple dynamic content not displaying in Safari??
chrishirst's Avatar
Super Moderator

Posts: 32,316
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
Code Samples | Crowded Nightclub? | Random Ramblings
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.12998 seconds with 13 queries