Note that there are some explanatory texts on larger screens.

plurals
  1. PO$.getJSON returning a 404 Not found in firebug
    text
    copied!<p>Here is my $.getJSON function (this is suppose to hit a .ashx file and return a json serialized object, which it does, i have tested it):</p> <pre><code>$.getJSON($('#fileupload form').prop('action'), function (files) { var fu = $('#fileupload').data('fileupload'); alert("this is the files: " + files.toString); fu._adjustMaxNumberOfFiles(-files.length); fu._renderDownload(files) .appendTo($('#fileupload .files')) .fadeIn(function () { // Fix for IE7 and lower: $(this).show(); }); }); </code></pre> <p>EDIT:</p> <p>alert($('#fileupload form').prop('action')) &lt; returns 'undefined'</p> <p>somehow my js is being loaded before the markup so it probably cant find #fileupload on the page.</p> <p>Here is the FULL markup:</p> <pre><code>&lt;style type="text/css"&gt; @import url('http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.13/themes/base/jquery-ui.css'); @import url('/_layouts/IrvineCompany.SharePoint.CLM/css/jquery.fileupload-ui.css'); @import url('/_layouts/IrvineCompany.SharePoint.CLM/css/style.css'); &lt;/style&gt; &lt;script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js"&gt;&lt;/script&gt; &lt;script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.13/jquery-ui.min.js"&gt;&lt;/script&gt; &lt;script src="http://ajax.aspnetcdn.com/ajax/jquery.templates/beta1/jquery.tmpl.min.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="/_layouts/IrvineCompany.SharePoint.CLM/js/UploadFile/jquery.iframe-transport.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="/_layouts/IrvineCompany.SharePoint.CLM/js/UploadFile/jquery.fileupload.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="/_layouts/IrvineCompany.SharePoint.CLM/js/UploadFile/jquery.fileupload-ui.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="/_layouts/IrvineCompany.SharePoint.CLM/js/UploadFile/application.js"&gt;&lt;/script&gt; &lt;div id="fileupload"&gt; &lt;form action="/_layouts/IrvineCompany.SharePoint.CLM/aspx/Upload.ashx" method="post" enctype="multipart/form-data"&gt; &lt;div class="fileupload-buttonbar"&gt; &lt;label class="fileinput-button"&gt; &lt;span&gt;Add files...&lt;/span&gt; &lt;input type="file" name="files[]" multiple="multiple" /&gt; &lt;/label&gt; &lt;%-- &lt;button type="submit" class="start"&gt;Start upload&lt;/button&gt; &lt;button type="reset" class="cancel"&gt;Cancel upload&lt;/button&gt; --%&gt; &lt;button type="button" class="delete"&gt;Delete all files&lt;/button&gt; &lt;div class="fileupload-progressbar"&gt;&lt;/div&gt; &lt;/div&gt; &lt;/form&gt; &lt;div class="fileupload-content"&gt; &lt;table class="files"&gt;&lt;/table&gt; &lt;/div&gt; &lt;/div&gt; &lt;script id="template-upload" type="text/x-jquery-tmpl"&gt; &lt;tr class="template-upload{{if error}} ui-state-error{{/if}}"&gt; &lt;td class="preview"&gt;&lt;/td&gt; &lt;td class="name"&gt;${name}&lt;/td&gt; &lt;td class="size"&gt;${sizef}&lt;/td&gt; {{if error}} &lt;td class="error" colspan="2"&gt;Error: {{if error === 'maxFileSize'}}File is too big {{else error === 'minFileSize'}}File is too small {{else error === 'acceptFileTypes'}}Filetype not allowed {{else error === 'maxNumberOfFiles'}}Max number of files exceeded {{else}}${error} {{/if}} &lt;/td&gt; {{else}} &lt;td class="progress"&gt;&lt;div&gt;&lt;/div&gt;&lt;/td&gt; &lt;td class="start"&gt;&lt;button&gt;Start&lt;/button&gt;&lt;/td&gt; {{/if}} &lt;td class="cancel"&gt;&lt;button&gt;Cancel&lt;/button&gt;&lt;/td&gt; &lt;/tr&gt; &lt;/script&gt; &lt;script id="template-download" type="text/x-jquery-tmpl"&gt; &lt;tr class="template-download{{if error}} ui-state-error{{/if}}"&gt; {{if error}} &lt;td&gt;&lt;/td&gt; &lt;td class="name"&gt;${name}&lt;/td&gt; &lt;td class="size"&gt;${sizef}&lt;/td&gt; &lt;td class="error" colspan="2"&gt;Error: {{if error === 1}}File exceeds upload_max_filesize (php.ini directive) {{else error === 2}}File exceeds MAX_FILE_SIZE (HTML form directive) {{else error === 3}}File was only partially uploaded {{else error === 4}}No File was uploaded {{else error === 5}}Missing a temporary folder {{else error === 6}}Failed to write file to disk {{else error === 7}}File upload stopped by extension {{else error === 'maxFileSize'}}File is too big {{else error === 'minFileSize'}}File is too small {{else error === 'acceptFileTypes'}}Filetype not allowed {{else error === 'maxNumberOfFiles'}}Max number of files exceeded {{else error === 'uploadedBytes'}}Uploaded bytes exceed file size {{else error === 'emptyResult'}}Empty file upload result {{else}}${error} {{/if}} &lt;/td&gt; {{else}} &lt;td class="preview"&gt; {{if thumbnail_url}} &lt;a href="${url}" target="_blank"&gt;&lt;img src="${thumbnail_url}"&gt;&lt;/a&gt; {{/if}} &lt;/td&gt; &lt;td class="name"&gt; &lt;a href="${url}"{{if thumbnail_url}} target="_blank"{{/if}}&gt;${name}&lt;/a&gt; &lt;/td&gt; &lt;td class="size"&gt;${sizef}&lt;/td&gt; &lt;td colspan="2"&gt;&lt;/td&gt; {{/if}} &lt;td class="delete"&gt; &lt;button data-type="${delete_type}" data-url="${delete_url}"&gt;Delete&lt;/button&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/script&gt; </code></pre> <p>EDIT:</p> <p>Checked my markup, for some reason i have my form tag in there, but it disappears when i check the actual markup for the website.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload