Go Back   CodingForums.com > :: Client side development > JavaScript programming > JavaScript frameworks

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 06-05-2009, 09:05 AM   PM User | #1
sionice
New Coder

 
Join Date: May 2009
Posts: 26
Thanks: 2
Thanked 0 Times in 0 Posts
sionice is an unknown quantity at this point
JQuery Error

Brief History:
I'm working on a project that uploads some files to my server (all local still, so nothing live). I'm using JQuery for a lightbox feature, so I thought I'd try using the JQuery file upload addon posted here:
http://www.phpletter.com/Our-Projects/AjaxFileUpload/

Everything is working great, though I notice certain types of files (for example wmv) are causing the upload plugin to fail and popup an error, and I'm not sure why. I've tracked it down to this snippet of code however:
Code:
try 
{
     status = isTimeout != "timeout" ? "success" : "error";
     // Make sure that the request was successful or notmodified
     if ( status != "error" )
     {
          // process the data (runs the xml through httpData regardless of callback)
          var data = jQuery.uploadHttpData( xml, s.dataType );    
          // If a local callback was specified, fire it and pass it the data
          if ( s.success )
               s.success( data, status );
    
               // Fire the global callback
               if( s.global )
                    jQuery.event.trigger( "ajaxSuccess", [xml, s] );
     }
     else
          jQuery.handleError(s, xml, status);
} 
catch(e) 
{
     status = "error";
     jQuery.handleError(s, xml, status, e);
}
More specifically, I believe I can't imagine this is anything else but the call:
Code:
jQuery.uploadHttpData( xml, s.dataType );
The exact error I'm getting is:
"SyntaxError: Unexpected token <"

Any thoughts on what could cause that? Do I maybe have a version mis-match between my jquery, and the jquery that this upload tool expects? That's my only real guess.

Thanks

Edit: I'm using JQuery 1.2.3 according to the header in my jquery.js file.

Last edited by sionice; 06-05-2009 at 09:07 AM..
sionice is offline   Reply With Quote
Old 06-05-2009, 09:17 AM   PM User | #2
abduraooft
Supreme Master coder!

 
abduraooft's Avatar
 
Join Date: Mar 2007
Location: N/A
Posts: 14,689
Thanks: 158
Thanked 2,184 Times in 2,171 Posts
abduraooft is just really niceabduraooft is just really niceabduraooft is just really niceabduraooft is just really niceabduraooft is just really nice
Quote:
The exact error I'm getting is:
"SyntaxError: Unexpected token <"
Could you post a link to your page?
__________________
Quote:
The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)
abduraooft is offline   Reply With Quote
Old 06-05-2009, 04:41 PM   PM User | #3
sionice
New Coder

 
Join Date: May 2009
Posts: 26
Thanks: 2
Thanked 0 Times in 0 Posts
sionice is an unknown quantity at this point
Quote:
Originally Posted by abduraooft View Post
Could you post a link to your page?
No, unfortunately this is strictly on my local server and nothing is live yet since it doesn't work. I'm probably going to try updating to JQuery 1.3.1 later today to see if that changes anything though.
sionice is offline   Reply With Quote
Old 06-05-2009, 06:16 PM   PM User | #4
A1ien51
Senior Coder

 
A1ien51's Avatar
 
Join Date: Jun 2002
Location: Between DC and Baltimore In a Cave
Posts: 2,717
Thanks: 1
Thanked 94 Times in 88 Posts
A1ien51 will become famous soon enough
Have you tried to set a break point and walk through the code and see where it dies?

Are you 100% your XML is valid?

Eric
__________________
Tech Author [Ajax In Action, JavaScript: Visual Blueprint]
A1ien51 is offline   Reply With Quote
Users who have thanked A1ien51 for this post:
sionice (06-05-2009)
Old 06-05-2009, 06:28 PM   PM User | #5
sionice
New Coder

 
Join Date: May 2009
Posts: 26
Thanks: 2
Thanked 0 Times in 0 Posts
sionice is an unknown quantity at this point
Quote:
Originally Posted by A1ien51 View Post
Have you tried to set a break point and walk through the code and see where it dies?

Are you 100% your XML is valid?

Eric
Well, I'm fairly certain because it works on almost all other files/types. However, I did just successfully upload another .wmv file to my server, so it's something specific having to do with this one file in particular that's failing.

As a note, I updated to 1.3.1 and still had the same issue.

I'm still pretty new to debugging javascript code, though I do have Web Developer running on Firefox, and it wasn't throwing any javascript errors. I'm totally open to a better recommendation on methods of debugging if you have them. =)
sionice is offline   Reply With Quote
Old 06-06-2009, 01:23 AM   PM User | #6
sionice
New Coder

 
Join Date: May 2009
Posts: 26
Thanks: 2
Thanked 0 Times in 0 Posts
sionice is an unknown quantity at this point
For those who might be running into the same issue, my problem was hella retarded.

It had nothing to do with the file itself, but rather poor error reporting on the end of the upload plugin. It was working on some files because, while I had changed "upload_max_filesize" in my php.ini file, I neglected to change "post_max_size" like the noob that I am.

That's what I get for learning this in a week and configuring a server for the first time. =P

Hope this helps someone out there down the road. =)
sionice is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 12:42 AM.


Advertisement
Log in to turn off these ads.