...

View Full Version : JQuery Error



sionice
06-05-2009, 10:05 AM
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:


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:


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.

abduraooft
06-05-2009, 10:17 AM
The exact error I'm getting is:
"SyntaxError: Unexpected token <" Could you post a link to your page?

sionice
06-05-2009, 05:41 PM
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.

A1ien51
06-05-2009, 07:16 PM
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

sionice
06-05-2009, 07:28 PM
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
06-06-2009, 02:23 AM
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. =)



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum