PDA

View Full Version : Done, but with errors on the page.


Grumpy ol' Jim
11-29-2004, 02:38 AM
The subject of this thread is the error message I get in the status bar when I click on any link to go to any page on my site. This error did not occur before I installed CMPS. When I ckick the refresh button, I get a clean page with no errors. Happens every time.

Can you tell me what I can do to find out what the errors on the page are and how I can prevent this from happening?

linky: http://forums.themadmodder.com/cmps_index.php

Thank you,

Jim

Brian
11-29-2004, 02:41 AM
Does the error still occur if you revert your navbar template to the default?

Our Sponsors
 

Grumpy ol' Jim
11-29-2004, 03:01 AM
Hi Brian, yes, it does. It was happening before I changed the navbar.

I just checked the page loading using Netscape, Opera and Firefox. It must be a problem with MS Internet Explorer because I don't get any errors using the other browsers. It may be that I don't have the other browsers configured to report errors though. Do you get the errors when you navigate my site using different browsers?

Thanks for your very quick reply. Glad to see I am not the only night-owl.

Jim

Brian
11-29-2004, 11:03 AM
Yup, I did get the error exactly how you described (and it goes away after a refresh). It doesn't make sense though that reverting your navbar wouldn't solve the problem. Checking the code, it looks like the ' mark highlighted is what's causing it...

if (confirm('C'mon, stick around a while. Are you sure you want to log out?'))

Javascript isn't exactly my area of expertise, but I'm pretty sure if you add a \ in front of that mark, or remove it, then that should make the error go away.

Our Sponsors
 

Grumpy ol' Jim
11-29-2004, 11:20 AM
I don't see anything highlighted in your code. Do you mean here: "/'C'mon," or here: "/?"

Oh wait, I see it -- the apostrophe in "C'mon". Right? Hard to see the red. That word is slang for "come on". Should it have a slash before the ' mark?

Thanks,

Jim

Brian
11-29-2004, 11:26 AM
I just modifed the post so it should be a little more obvious which ' mark I was talking about. ;)

I would suggest changing it to C\'mon and see if that helps. If not, try taking the ' mark out and see if that fixes the error and then you'll at least know that is for sure what's causing the error.

Grumpy ol' Jim
11-29-2004, 11:48 AM
You\'re right. ;) I first tried the wrong slash (you can see my mistake in my last reply) and it didn't work, but deleting that part of the phrase did. After seeing my mistake, I added that part of the phrase back with the correct slash and it works just fine now.

I didn't know editing phrases could have that effect. Is there a "rule of thumb" concerning apostrophes in php? Does your ability to read my code mean I am not secure? Point me in the right direction to learn more about that, if you will.

Thank you for your help. I am looking forward to making CMPS more functional and an integral part of my site.

Jim

Brian
11-29-2004, 12:01 PM
The reason the apostrophe in that phrase was causing a problem is because it's in a javascript function, and most of the time apostrophes in javascript need to have a \ mark added before them. There isn't any security hole on your site (at least that I'm aware of). I just viewed the source of your page to find the problem. ;)

Grumpy ol' Jim
11-29-2004, 05:03 PM
Thanks again, Brian. I not only got my problem fixed, I learned a couple new things.

Jim