PDA

View Full Version : Marquee and Apostrophes



htdefiant
09-26-2008, 12:09 AM
I am using the Cross browser Marquee script- Dynamic Drive (www.dynamicdrive.com). When I put a word like can't into the script, it does not render on the page. But, when I change can't to cant, everything works just fine. What can I do about this?

Nile
09-26-2008, 12:16 AM
Can you post a link to your page, and the page and dd?

htdefiant
09-26-2008, 12:22 AM
Not sure if this is exactly what you are looking for, but:

http://match.collegiate-va.org is the url. On the source of that page is the marquee.

Nile
09-26-2008, 12:35 AM
Also, where on the page? And then, where'd you get the code from(the page on dd). As in, link to it.
Thanks,
Nile
PS:
Your problem is a really big problem that is not that obvious, so if I fix it, I think ddadmin will update it. Or he will do it himself.

TheJoshMan
09-26-2008, 12:53 AM
using firebug I just inserted the apostrophe into the word can't and it worked fine...



"ugh- I just hate not having money, cause, like, you can't, like...go to Starbucks!" -Emma Massie..

htdefiant
09-26-2008, 01:00 AM
Sorry, Nayne, what's firebug?

Nile
09-26-2008, 01:05 AM
Same with me, it doesn't look to me like in that page your actually rendering the div you want to scroll. What div do you want to scroll? Give me the id.
Firebug is an online tool to help you solve codes(as in problems with your code):
https://addons.mozilla.org/en-US/firefox/addon/1843
To me it doesn't look like firebug will help you considering your not calling the function, but its always good for future reference.

htdefiant
09-26-2008, 09:06 PM
Sorry, Nile, I am a total novice at this --- what's a div?

Nile
09-26-2008, 09:47 PM
<div>
</div>

That is a div. :)

htdefiant
09-26-2008, 10:14 PM
the divid = container

jscheuer1
09-27-2008, 04:23 AM
If you want to use an apostrophe (') you need to escape it (comment from the source code):



//Keep all content on ONE line, and backslash any single quotations (ie: that\'s great):

So, if:


can't

is giving you a problem, make it:


can\'t

TheJoshMan
09-27-2008, 04:31 AM
hey john, I really don't think that was their problem. I added in an apostrophe without escaping it and it worked fine.

I also tried using one WITH escaping it, and it showed the slash as well.

jscheuer1
09-27-2008, 04:38 AM
hey john, I really don't think that was their problem. I added in an apostrophe without escaping it and it worked fine.

I also tried using one WITH escaping it, and it showed the slash as well.

Well, it is the way the script was written. In any case - simple rule of thumb - if the string is delimited with ('), then (') within it must be escaped - if it is delimited with ("), then (") within it must be escaped.

If you are adding code via Firebug or some other utility though, you may get different results. The proof however is in the pudding - how does it actually work on a live page.

TheJoshMan
09-27-2008, 04:40 AM
true.

...but is it *chocolate* pudding?

jscheuer1
09-27-2008, 04:51 AM
true.

...but is it *chocolate* pudding?

That makes no difference. When testing javascript code - to have a realistic chance of the outcome, if at all possible, unless you just 'know' - one must make a local copy of the page and then try out one's ideas on it.

htdefiant
09-27-2008, 03:34 PM
Yes, the pudding is in fact chocolate. Thank you all for your help.