By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,319 Members | 2,361 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,319 IT Pros & Developers. It's quick & easy.

'No element found' error

P: n/a
Hi All,

I am not sure if this is a JavaScript or PHP error. Basically what
is happening, is that I have an HTML page with the following
JavaScript. As you can see makeRequest() calls a PHP script which is
included below.

When the code is executed, I get the following error in FireFox's
JavaScript console;
>>>> Start Error Message <<<<<<<
Error: no element found
Source File:
http://127.0.0.1:8000/pscripts/scr00...=tacoma&stt=47
Line: 1, Column: 1
Source Code:
^
>>>> End Error Message <<<<<<<
>>>> Start JavaScript <<<<<<<
<script language="javascript" type="text/javascript">
var result ;
var http_request = false ;
var ng= -1 ;
var reqFlag="available" ;

function makeRequest(url, parameters) {
http_request = false;
if (window.XMLHttpRequest) { // Mozilla, Safari,...
http_request = new XMLHttpRequest();
if (http_request.overrideMimeType) {
http_request.overrideMimeType('text/xml');
}
} else if (window.ActiveXObject) { // IE
try {
http_request = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
http_request = new ActiveXObject("Microsoft.XMLHTTP");
} catch (e) {}
}
}
if (!http_request) {
alert('Cannot create XMLHTTP instance');
return false;
}
http_request.onreadystatechange = alertContents;
http_request.open('GET', url + parameters, false);
http_request.send(null);
}

function alertContents() {
if (http_request.readyState == 4) {
if (http_request.status == 200) {
//alert(http_request.responseText);
result = http_request.responseText;
RtVal = result;
} else {
alert('There was a problem with the request.');
}
}
}

function wrtmmbr()
{
if (vrfd=="submitted") {
alert ("Membership has been approved for "+vunm) ; return; }
if (vrfd=="yes") {
vunm = document.crnew.unm.value;
vpsswrd = document.crnew.psswrd.value;
veml = document.crnew.eml.value;
vhsnm = document.crnew.hsfname.value;
vhrnm = document.crnew.hrfname.value;
vcty = document.crnew.cty.value;
vstt = document.crnew.stt.value;

prm="?unm="+vunm+"&psswrd="+vpsswrd+"&eml="+veml+" &hsnm="+vhsnm+"&hrnm="+vhrnm+"&cty="+vcty+"&stt="+ vstt;
reqFlag="wrtProfile" ; makeRequest('pscripts/scr0003.php',prm);
vrfd="submitted" ;
alert("Your Membership has been created, please log in.");
window.open("memberlogin.html","_self"); }
}
function ProcessData()
{
switch(reqFlag)
{
case 'chkUName' :
thrspns = result.indexOf("au~~th");
if (thrspns>ng) {
} else
{
alert(tmp2+" is not available. Please try again.");
document.crnew.cunm.focus(); return ;
}
break ;
case 'chkCity' :
thrspns = result.indexOf("fou~~und");
if (thrspns<0) {
alert("We can not find a City named "+tmp2) ;
document.crnew.stt.focus(); }
break ;
case 'wrtPassword' :
return;
break ;
case 'wrtProfile' :
return;
break ;
}
}
</script>
>>>> End JavaScript <<<<<<<
>>>> Start PHP Script <<<<<<<
<?php

$host = "127.0.0.1";
$login = "root";
$pwd = "AntonMlaber";
$port = "3306";
$db = "mmbrdt";
$tblnm = "membership" ;
$lunm = $_REQUEST["unm"];
$lpsswrd = $_REQUEST["psswrd"];
$leml = $_REQUEST["eml"];
$lhsnm = $_REQUEST["hsnm"];
$lhrnm = $_REQUEST["hrnm"];
$lcty = $_REQUEST["cty"];
$lstt = $_REQUEST["stt"];
$tm = array() ;
$tm=localtime();
$tday = $tm[3];
$tmh = $tm[4] ;
$tmonth = $tmh+1 ;
$tyr = $tm[5] ;
$tyear = $tyr+1900;
$ll=$tyear."-".$tmonth."-".$tday;
$lsd=$tyear."-".$tmonth."-".$tday;
$host=$host.":".(integer)$port;
$conn=mysql_connect($host,$login,$pwd) or die();
$sql = "INSERT INTO $tblnm
(UserName,UserPassword,EmailAddress,HisFName,HerFN ame,City,State,RegDate,LastLogon,RenewalDate)
VALUES
('$lunm','$lpsswrd','$leml','$lhsnm','$lhrnm','$lc ty','$lstt','$ll','$ll','$lsd')";
mysql_select_db($db,$conn) ;
mysql_query($sql);

$sql = "SELECT UserName FROM $tblnm WHERE UserName='$lunm'";
mysql_select_db($db,$conn) ;
$ProNum = mysql_query($sql);

$host = "127.0.0.1";
$login = "root";
$pwd = "AntonMlaber";
$port = "3306";
$db = "upw";
$tblnm = "pwds" ;
$sql = "INSERT INTO $tblnm (UserID,UserName,UserPwd,LastLogon)
VALUES ('$ProNum','$lunm','$lpsswrd','$ll')";
mysql_select_db($db,$conn) ;
mysql_query($sql);

?>
>>>> End PHP Script <<<<<<<
Aug 21 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
On Mon, 21 Aug 2006 14:46:40 -0600, "C.Joseph Drayton" <cs***@tlerma.com>
wrote:
>I am not sure if this is a JavaScript or PHP error. Basically what
is happening, is that I have an HTML page with the following
JavaScript. As you can see makeRequest() calls a PHP script which is
included below.

When the code is executed, I get the following error in FireFox's
JavaScript console;
>>>>> Start Error Message <<<<<<<
Error: no element found
Source File:
http://127.0.0.1:8000/pscripts/scr00...=tacoma&stt=47
Line: 1, Column: 1
Source Code:
^
>>>>> End Error Message <<<<<<<
It's a Javascript error, probably from your XMLHTTPRequest, and further
probably from the request returning an empty string or something non-XML.

Install a Javascript debugger, such as Firebug [1], which will help you find
what's actually going on.

[1] http://www.joehewitt.com/software/firebug/

Follow-ups set to comp.lang.javascript.

--
Andy Hassall :: an**@andyh.co.uk :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool
Aug 21 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.