Note that there are some explanatory texts on larger screens.

plurals
  1. POFirefox error 'no element found'
    primarykey
    data
    text
    <p>First off, this isn't exactly the ideal way of setting up a page, however there's a need to distribute a script as 1 file. </p> <p>I have a php script at the top of an otherwise xhtml document with javascript, and under certain conditions use XHR to send a query string to the page itself. The php at the top then activates, and stores the passed content as a session, and then kills itself (exit()). The XHR is async and is never checked to see if it returns content.</p> <p>However in Firefox 3, the error console throws an error <code>no element found</code> every time the XHR request gets sent. Also, if I use an exit such as <code>exit('Done')</code>, Firefox throws a syntax error of (Done) as if it inserts it into the visible DOM. This doesn't seem to happen in Opera.</p> <p>Is there a better way to store a session from an already generated xhtml page? Obviously I could XHR to another page, but I would prefer to keep it all on one script. Does Firefox treat XHR requests to self as updates to the DOM? I don't know why it's sending this error. </p> <hr> <p><strong>Update</strong> As I said, firefox only thows the error when the XHR request is made. The page is valid XHTML and works perfectly, without error unless the XHR request is made to the page itself. </p> <p>I was wondering why it was sending the error because it really doesn't return anything.</p> <p>Here's a javascript snippet that makes a ajax request from an object. It creates a XHR object, without a callback function, and posts the information. It works properly when not referencing the same page. </p> <pre><code> var saveState = { saveContent: function(updateActiveMenu) { var sendState = new ajaxObject(gV.url); if (!updateActiveMenu) { var storageContainer = document.getElementById("StorageContainer").innerHTML; var menu = document.getElementById("Nav").innerHTML; sendState.update("Containerstring="+urlencode(storageContainer)+"&amp;Nav="+urlencode(menu)+"&amp;Active="+gV.activeMenuItem, 'POST', true); } }, } </code></pre> <p>And the php does this</p> <pre><code>if (isset($_REQUEST['Containerstring']) &amp;&amp; isset($_REQUEST['Nav']) &amp;&amp; isset($_REQUEST['Active'])) { $_SESSION['Containerarray'] = (saveContainer(regulateEscapes(urldecode($_REQUEST['Containerstring'])))); $_SESSION['Navarray'] = (saveNav(regulateEscapes(urldecode($_REQUEST['Nav'])))); $_SESSION['Active'] = $_REQUEST['Active']; exit('Done'); } </code></pre> <p>I'm also aware I shouldn't be using innerHTML but that's another story</p> <hr> <p>The error is this</p> <pre><code>Error: no element found Source File: http://localhost/ajax.php?1244648094055 Line: 1 </code></pre> <p>Note that the error, while on the php page I'm using, references a query string that is never called.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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