Jump to content

confused with divs?


Porkie

Recommended Posts

i was wondering where iam goin wrong with this code? i normally work with <table> not <div> so any help will be greatly appreciated.

 

echo '<div id="rightcol">'<SCRIPT type="text/javascript" language="JavaScript" src="http://xslt.alexa.com/site_stats/js/s/a?url=www.source2.co.uk"></SCRIPT>'</div>';

 

cheers

Link to comment
Share on other sites

That won't work either, lol. It's actually pretty simple; just remove the single quotes from within your string:

 

echo '<div id="rightcol"><SCRIPT type="text/javascript" language="JavaScript" src="http://xslt.alexa.com/site_stats/js/s/a?url=www.source2.co.uk"></SCRIPT></div>';

Link to comment
Share on other sites

That won't work either, lol. It's actually pretty simple; just remove the single quotes from within your string:

 

echo '<div id="rightcol"><SCRIPT type="text/javascript" language="JavaScript" src="http://xslt.alexa.com/site_stats/js/s/a?url=www.source2.co.uk"></SCRIPT></div>';

 

echo '<div id="rightcol">';
echo '<SCRIPT type="text/javascript" language="JavaScript" src="http://xslt.alexa.com/site_stats/js/s/a?url=www.source2.co.uk">';
echo '</SCRIPT>';
echo '</div>';

 

This code will work fine but you're right in saying that if you remove the "" and add ' ' in it's place it will also work. or even  '" . '  ' . "

 

 

Link to comment
Share on other sites

Try this

echo '<div id="rightcol">';
echo '<SCRIPT type="text/javascript" language="JavaScript" src="http://xslt.alexa.com/site_stats/js/s/a?url=www.source2.co.uk">';
echo '</SCRIPT>';
echo '</div>';

 

This code should work fine if not change all the " " to ' ' and the ' ' to " "

e.g. echo "</div>";

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.