久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

Firefox 錯(cuò)誤“未找到元素"

Firefox error #39;no element found#39;(Firefox 錯(cuò)誤“未找到元素)
本文介紹了Firefox 錯(cuò)誤“未找到元素"的處理方法,對大家解決問題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

問題描述

首先,這并不是設(shè)置頁面的理想方式,但是需要將腳本作為 1 個(gè)文件分發(fā).

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.

我在帶有 javascript 的其他 xhtml 文檔的頂部有一個(gè) php 腳本,并且在某些條件下使用 XHR 將查詢字符串發(fā)送到頁面本身.然后頂部的 php 激活,并將傳遞的內(nèi)容存儲(chǔ)為會(huì)話,然后自行終止(exit()).XHR 是異步的,從不檢查它是否返回內(nèi)容.

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.

但是在 Firefox 3 中,每次發(fā)送 XHR 請求時(shí),錯(cuò)誤控制臺(tái)都會(huì)拋出錯(cuò)誤 no element found.此外,如果我使用諸如 exit('Done') 之類的出口,F(xiàn)irefox 會(huì)拋出 (Done) 的語法錯(cuò)誤,就像將其插入可見 DOM 一樣.這在 Opera 中似乎不會(huì)發(fā)生.

However in Firefox 3, the error console throws an error no element found every time the XHR request gets sent. Also, if I use an exit such as exit('Done'), Firefox throws a syntax error of (Done) as if it inserts it into the visible DOM. This doesn't seem to happen in Opera.

是否有更好的方法來存儲(chǔ)來自已生成的 xhtml 頁面的會(huì)話?顯然我可以 XHR 到另一個(gè)頁面,但我更愿意將所有內(nèi)容都保存在一個(gè)腳本中.Firefox 是否將 XHR 對 self 的請求視為對 DOM 的更新?我不知道為什么它會(huì)發(fā)送此錯(cuò)誤.

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.

更新 正如我所說,firefox 僅在發(fā)出 XHR 請求時(shí)才會(huì)顯示錯(cuò)誤.該頁面是有效的 XHTML 并且可以完美運(yùn)行,除非向頁面本身發(fā)出 XHR 請求,否則不會(huì)出錯(cuò).

Update 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.

我想知道為什么它會(huì)發(fā)送錯(cuò)誤,因?yàn)樗娴臎]有返回任何東西.

I was wondering why it was sending the error because it really doesn't return anything.

這是一個(gè)從對象發(fā)出 ajax 請求的 javascript 片段.它創(chuàng)建一個(gè) XHR 對象,沒有回調(diào)函數(shù),并發(fā)布信息.當(dāng)不引用同一頁面時(shí),它可以正常工作.

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.

 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)+"&Nav="+urlencode(menu)+"&Active="+gV.activeMenuItem, 'POST', true);    } }, }

php 就是這樣做的

if (isset($_REQUEST['Containerstring']) && isset($_REQUEST['Nav']) && isset($_REQUEST['Active'])) {
  $_SESSION['Containerarray'] = (saveContainer(regulateEscapes(urldecode($_REQUEST['Containerstring']))));
  $_SESSION['Navarray'] = (saveNav(regulateEscapes(urldecode($_REQUEST['Nav']))));
  $_SESSION['Active'] = $_REQUEST['Active'];
  exit('Done'); 
}

我也知道我不應(yīng)該使用innerHTML,但那是另一回事

I'm also aware I shouldn't be using innerHTML but that's another story

錯(cuò)誤是這樣的

Error: no element found
Source File: http://localhost/ajax.php?1244648094055 
Line: 1

請注意,該錯(cuò)誤在我使用的 php 頁面上引用了一個(gè)從未調(diào)用過的查詢字符串.

Note that the error, while on the php page I'm using, references a query string that is never called.

推薦答案

Firefox 希望得到一些它可以解析為 XML 的東西,并在得到空響應(yīng)時(shí)拋出 XML 解析錯(cuò)誤.

Firefox is expecting to get something it can parse as XML back, and throwing an XML parsing error when it gets an empty response.

在 PHP 調(diào)用exit()"之前,使用

Before your PHP calls "exit()", use

header('Content-Type: text/plain');

并且 Firefox 不會(huì)嘗試將響應(yīng)解析為 XML,并且應(yīng)該沒有錯(cuò)誤.

and Firefox will not try to parse the response as XML, and there should be no error.

這篇關(guān)于Firefox 錯(cuò)誤“未找到元素"的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請聯(lián)系我們刪除處理,感謝您的支持!

相關(guān)文檔推薦

Joining 2 tables in SELECT(MYSQL/PHP)(在 SELECT(MYSQL/PHP) 中加入 2 個(gè)表)
How to make lt;option selected=quot;selectedquot;gt; set by MySQL and PHP?(如何使lt;option selected=“selectedgt;由 MySQL 和 PHP 設(shè)置?)
Auto populate a select box using an array in PHP(使用 PHP 中的數(shù)組自動(dòng)填充選擇框)
PHP SQL SELECT where like search item with multiple words(PHP SQL SELECT where like search item with multiple words)
json_encode produce JSON_ERROR_UTF8 from MSSQL-SELECT(json_encode 從 MSSQL-SELECT 產(chǎn)生 JSON_ERROR_UTF8)
MySQL ORDER BY rand(), name ASC(MySQL ORDER BY rand(),名稱 ASC)
主站蜘蛛池模板: 国产黄色在线观看 | 久久久夜色精品 | 成人久久视频 | 国产精品一区二区三 | www.青青草 | 亚洲乱码在线 | 婷婷99 | 中文字幕高清在线 | 91天堂网 | 亚洲精品一二三四区 | 激情91 | 91成人国产 | 亚洲精品一二区 | 国产91一区| 国产免费一级 | 天天摸天天爽 | 激情视频网址 | 日韩一区二区中文字幕 | 国产福利小视频 | 一区二区在线免费观看 | 99精品在线观看 | 成人精品 | 日本在线视频一区二区 | 精品免费视频 | 欧美激情国产精品 | 日韩av中文字幕在线播放 | 五月婷婷丁香花 | 久久久久久久影院 | 中文字幕在线视频播放 | 精品国产一区二 | 操碰在线视频 | 亚洲天堂网在线观看 | 日韩av免费在线播放 | 国产综合自拍 | 欧美性色网 | 欧美成人区 | 3d动漫精品h区xxxxx区 | 久久99热这里只频精品6学生 | 亚洲国产欧美日韩在线 | 国产又粗又大又硬 | 午夜性色 |