I am trying to implement this jQuery form plugin to do ajax file uploads. Although the documentation is great I am still a little unclear about one thing. Usually when I do ajax submissions I return a response in JSON(using PHP), something like :
When doing some simple tests I have run into a problem and I believe it is due to the way this plugin handles JSON responses. My form :
This does not result in the success event firing but rather the error event. In the plugin documentation it states that it does not handle json responses well and that it recommends wrapping the response in a textarea. Unfortunatly I'm not sure what they mean by that, and what I've tried so far has not worked. ould anyone give me some advice as to how to output the response in JSON properly? Could anyone that has used this plugin for AJAX file uploads offer any advice on doing so?
From the little I've read in this plugin's source code, ajaxSubmit() switches to "iframe mode" whenever it detects a file link in the form. The file is uploaded fine, but the server, which normally replies with different content. based on HTTP_X_REQUESTED_WITH header, fails to do its thing. This header is normally set to "XMLHttpRequest" on normal jQuery .ajax() calls.
The server I'm running is on rails, and I'm using the "request.xhr?" test.
I admit I'm not too familiar with iframes (or jQuery, for that matter:), but surely there must be a way to get around this, so that this can act as a simple drop-in replacement. Should I be looking at other headers, like "Accepts" or the kind, or should the plugin (or my code) be forcing the HTTP_X_REQUESTED_WITH header?
I've added file upload support to the form plugin and I could use some help testing it out.If this feature interests you then go ahead and grab the beta plugin at:URL...File upload support is baked right into the plugin and there are no external dependencies.The plugin will automatically detect file input elements and use an iframe to submit the form if there are files to be uploaded.No extra coding or metadata is needed to take advantage of this new feature.In addition, even though an iframe is used instead of the XHR object, callbacks and global triggers still work as expected (so any code that you have in place to display activity indicators or blocking elements will still work).However, there are some challenges when using iframes in this manner.For one, it is quite difficult to determine if the submit operation succeeded or failed.The iframe becomes the target of the submit operation and so that is where the server response is written.The form plugin does its best to determine the data type (html, xml, etc),but the status is always 'success' unless an exception is caught during the type determination.URL...
If you use this page for testing *please* be kind to my server and only upload small files! I'd really prefer that you download the plugin and integrate it into your own test environment if possible.I've done some testing on FF, IE and Opera and the results are encouraging. I don't have access to Safari so I'm sure there are issues lurking for that platform.If you're interested in the code you can find it all tucked into the end of the ajaxSubmit method in a function called "fileUpload".
When the tabs are initialized by this code:$( "#tabs" ).tabs(); , it displays the tabs in a way that I don't like. I want to trace into the actual 'tabs' function when this is called so I can see why it is doing what it is doing. I have not been able to find where this code is sitting.
I'm new to js/jquery and this forum so please forgive my potentially off-scope js/jquery remarks. I've been running a lot of toggles to show, hide, etc... divs and other HTML elements. It's making my application incredibly nice navigation wise.
Now to put myself in my users shoes. Say one user toggles on and off the things they want and don't want until they are satisfied with all the content of the screen. (That is by the way the nature of my application. A user loads in various variables via PHP and other means and when satisfied, a PDF is generated for them containing all their preferred content.)
Because: When a user is at a point where all the content they are viewing is worthy of a PDF, it is also worth saving that HTML 'view' (classes switched, variable adjusted, etc...). I would call it 'Save this workspace' or something along those lines.
I don't have a direct question per se but am more interested in the views of others who have similar thoughts and moreover, what relationship has jQuery had in helping employing some method?
I have a e-mail on my myspace account and I didn't write it. How can I find out the IP addresse from where it originated? I have looked at it and looked at it but I can't find anything except my myspace account addresse on it. I want to know basically where to look to find out the computer or IP addresse that it originated from.
I would you grab the source code from an IFRAME and display it in a textarea?
I'm trying to create a sort of preview page that both shows a rendered page, then shows the source code next to it.
: I'm thinking that using OnLoad JS event in the HTML body tag would allow this to work. The page loads, the OnLoad event calls a JS function that pulls the innerHTML from the IFRAME and inserts it into the textarea.
I'm wondering, I've looked at several examples of this, but none seem to work. I can get POST functions to work (posting data to a certain URL is no problem). However, I can't get the source code of a page. Here's the function I've got so far:
I'm wanting to use this to use certain settings in the script on my web site that I have stored on another page. The usage is like this:
And then googlesource should be populated with the source code of [url]. Just an example. why the above function is not working? I've tried messing around with all kinds of request headers and everything.
So converting the code-as-string to code-as-source using the Function constructor is not working. Or else the event handler setting function or assignment is not what it should be.