Porkie Posted September 3, 2009 Share Posted September 3, 2009 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 Quote Link to comment Share on other sites More sharing options...
unknown1 Posted September 3, 2009 Share Posted September 3, 2009 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">'; '</SCRIPT>'; echo '</div>'; This code will work fine. Quote Link to comment Share on other sites More sharing options...
thebadbad Posted September 3, 2009 Share Posted September 3, 2009 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>'; Quote Link to comment Share on other sites More sharing options...
unknown1 Posted September 3, 2009 Share Posted September 3, 2009 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 '" . ' ' . " Quote Link to comment Share on other sites More sharing options...
unknown1 Posted September 3, 2009 Share Posted September 3, 2009 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>"; Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.