943,169 Members | Top Members by Rank

Ad:
You are currently viewing page 1 of this multi-page discussion thread
Aug 28th, 2010
0

I'm getting this error Expected '}'

Expand Post »
Hi, Everyone!!

I'm really new in this business and I've been having some trouble with these errors:

======================================================================
Message: Object expected
Line: 1
Char: 1
Code: 0
URI: http://www.myblog.com/successblog/
===================================================================
Message: Expected '}'
Line: 707
Char: 301
Code: 0
URI: http://www.myblog.com/successblog/
==================================================================
Message: Expected '}'
Line: 738
Char: 301
Code: 0
URI: http://www.myblog.com/successblog/
====================================================================
Also after my latest post my blog become a real mess and it keeps telling that:
(1 item remaining) waiting for http://www.myblog.com/successblog/

Can anybody help me with that? I really needs some urgent help

Thanks
Similar Threads
Reputation Points: 10
Solved Threads: 0
Light Poster
Queen007 is offline Offline
28 posts
since Jul 2010
Aug 28th, 2010
0
Re: I'm getting this error Expected '}'
If you don't have Firefox, install firefox.
Install the Firebug Addon.

After restarting firefox, load your page again. It should tell you a more helpful description of the problem. If the problem persists, post a link to your page.
Reputation Points: 116
Solved Threads: 243
Veteran Poster
hielo is offline Offline
1,123 posts
since Dec 2007
Aug 29th, 2010
0
Re: I'm getting this error Expected '}'
Hi, Hielo!!

Thanks for your interest in helping me.
I will do what you said asap.
about the link I can not do that here because violate the policy but you can tell me where else to send it to you.

Please I really need your help

Thanks in advance
Reputation Points: 10
Solved Threads: 0
Light Poster
Queen007 is offline Offline
28 posts
since Jul 2010
Aug 29th, 2010
0
Re: I'm getting this error Expected '}'
You can send it via Private Message here.
Reputation Points: 116
Solved Threads: 243
Veteran Poster
hielo is offline Offline
1,123 posts
since Dec 2007
Aug 29th, 2010
0
Re: I'm getting this error Expected '}'
Hi, Hielo!!

I have done all what you have been telling but I'm still lost.
How I use Firebug to look for my error?
Reputation Points: 10
Solved Threads: 0
Light Poster
Queen007 is offline Offline
28 posts
since Jul 2010
Aug 29th, 2010
0
Re: I'm getting this error Expected '}'
On the lower right-hand side of Firefox you will see a "bug". Click on it and reload your page.

On another note, I suggest you ALSO install "Web Developer" AddOn:

https://addons.mozilla.org/en-US/fir...lup=&advanced=

Once installed, restart firefox. You will see a new bar across the top of the browser. On THAT bar, the last icon on the far-right of the browser window will be red if there are errors.
Reputation Points: 116
Solved Threads: 243
Veteran Poster
hielo is offline Offline
1,123 posts
since Dec 2007
Aug 29th, 2010
0
Re: I'm getting this error Expected '}'
Thanks Hielo!!

I already did that. Now I'm sending you a private message with the errors and blog Success Blog
Reputation Points: 10
Solved Threads: 0
Light Poster
Queen007 is offline Offline
28 posts
since Jul 2010
Aug 29th, 2010
0
Re: I'm getting this error Expected '}'
On the Web Developer Toolbar there is an icon labeled "Information". Click it and then select "View Javascript".

Click on "Collapse All" then scroll to the last link and expand it. You should see the javascript code that is giving you problems - copy it.

Now open a new tab in Firefox and go to http://jsbeautifier.org/ and paste the code there. Check all the checkboxes and then submit.

At this point it should be clear to you that your php file is creating nested try{}catch() statements but ultimately is NOT closing them.

So, to fix the error you need to examine your php code. It seems that it is dynamically generating javascript from within some loop.

It should NOT be doing that from within a loop since:
a. it keeps sending code to validate the same fields over and over.
b. it is not sending the closing brace for your try (this is what the browser is complaining about).
Reputation Points: 116
Solved Threads: 243
Veteran Poster
hielo is offline Offline
1,123 posts
since Dec 2007
Aug 29th, 2010
0
Re: I'm getting this error Expected '}'
This is what it should be generating:
javascript Syntax (Toggle Plain Text)
  1. try
  2. {
  3. try
  4. {
  5. var pageTracker = _gat._getTracker("UA-8766636-3");
  6. pageTracker._trackPageview();
  7. }
  8. catch (err)
  9. {
  10. }
  11. }
  12. catch (e)
  13. {
  14. }
  15.  
  16. try
  17. {
  18. var myValidate = new Validate();
  19. myValidate.addRules(
  20. {
  21. id: "da_email",
  22. option: "required",
  23. error: "A valid email address is required."
  24. });
  25.  
  26. myValidate.addRules(
  27. {
  28. id: "da_email",
  29. option: "email",
  30. error: "A valid email address is required."
  31. });
  32.  
  33. myValidate.addRules(
  34. {
  35. id: "da_name",
  36. option: "required",
  37. error: "A valid name is required."
  38. });
  39.  
  40. myValidate.addRules(
  41. {
  42. id: "da_name",
  43. option: "simpleValidChars",
  44. error: "A valid name must not contain extra punctuation or special characters."
  45. });
  46. }
  47. catch(e){}
Reputation Points: 116
Solved Threads: 243
Veteran Poster
hielo is offline Offline
1,123 posts
since Dec 2007
Aug 29th, 2010
0
Re: I'm getting this error Expected '}'
Hi, Hielo!!

Sorry to bother you so constantly but this problem is driving me crazy.
I have done everything you have told me and more.
I copy/paste into my database the code you send me and although I was capable to identify other errors and fix them, there is one that still persist.

as a matter of fact is the same one but now is switching between 2 file:

1.- autoptimize_d9ef96f648396232a310cb90d9fae8ce.php.none

2.- autoptimize_9706271a8fa878d1d6953ca4d763ae6b.php.none

When I copy/paste the code you send me in one then the error appear in the other and so on.

Could you tell me how am I going to solve this?

Thanks in advance
Reputation Points: 10
Solved Threads: 0
Light Poster
Queen007 is offline Offline
28 posts
since Jul 2010

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in JavaScript / DHTML / AJAX Forum Timeline: Google MAPAPI
Next Thread in JavaScript / DHTML / AJAX Forum Timeline: jQuery if statement trouble





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC