GB_001 Posted June 1, 2008 Share Posted June 1, 2008 Hello, I keep getting an error pertaining to the document.Reggy values. stating that they are either null or not an object. The places where the errors are, are indicated with arrows. Thankyou, -GB <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <sc language='javascript' type='text/javascript'> <!-- // function rawr(){ var ajaxRequest; // The variable that makes Ajax possible! try{ // Opera 8.0+, Firefox, Safari ajaxRequest = new XMLHttpRequest(); } catch (e){ // Internet Explorer Browsers try{ ajaxRequest = new ActiveXObject('Msxml2.XMLHTTP'); } catch (e) { try{ ajaxRequest = new ActiveXObject('Microsoft.XMLHTTP'); } catch (e){ // Something went wrong alert('Your browser broke!'); return false; } } } // Create a function that will receive data sent from the server ajaxRequest.onreadystatechange = function(){ if(ajaxRequest.readyState == 4){ var ajaxDisplay = document.getElementById('mainiac'); ajaxDisplay.innerHTML = ajaxRequest.responseText; } } var url = 'Users.php'; [b]var f=document.Reggy.F.value;<------ var l=document.Reggy.L.value;<------ var s=document.Reggy.S.value;<------ var e=document.Reggy.E.value;<------ var p=document.Reggy.P.value;[/b];<------ var u = '?f='+f+'&l='+l+'&s='+s+'&e='+e+'&p='+p; ajaxRequest.open('GET', url, true); ajaxRequest.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); ajaxRequest.send(null); } //--> </s> </head> <body> <table align=right> <tr> <td style="background:url(bmain4.png) repeat-x; border: 1px solid white; text-align:bottom; color: #FFFFFF;"><b><center>Register</center></b><br> [b]<form name="Reggy" id="Reggy"/> <font color=white><b>First Name:</b><br> <input name="F" id="F" type="text" value="" size="20"/><br><------ <b>Last Name:</b><br> <input name="L" id="L" type="text" size="20" value=""/><br><------ <b>Email:</b><br> <input name="E" id="E" type="text" size="20" value="" /><br><------ <b>School Or Office:</b><br> <input name="S" id="S" type="text" size="20" value="" /><br><------ <b>Password:</b><br> <input name="P" id="P" type="password" size="20" value="" /><br></font><------ </form>[/b] <font color=black><b style="background-color:#AAAAAA; cursor: pointer;" onclick=rawr();>Submit</b> </td> </tr> </table> </body> </html> Quote Link to comment Share on other sites More sharing options...
Psycho Posted June 2, 2008 Share Posted June 2, 2008 The code would be much easier to debug if it was propery indented to follwo the structure. I did go through it and found several problems which solved some of the problems. 1. The opening and closing script tags are wrong. The opening script tag uses "sc" and the closing uses just "s" 2. There is BBCode bold tags within the script ( & ). Quote Link to comment Share on other sites More sharing options...
GB_001 Posted June 2, 2008 Author Share Posted June 2, 2008 I put sc because of the security on the site. ans I tried the bold the code for it to be easier to see Quote Link to comment Share on other sites More sharing options...
Psycho Posted June 2, 2008 Share Posted June 2, 2008 I put sc because of the security on the site. ans I tried the bold the code for it to be easier to see This site has [ code ] tags for the specific purpose of being able to properly "display" code as opposed to having it interpreted. Also, bold tags don't work in code tags. Quote Link to comment Share on other sites More sharing options...
GB_001 Posted June 2, 2008 Author Share Posted June 2, 2008 Okay, But before i wasn't able to post code with the <script> tag. Anyways we are getting off topic any ideas on how to help me? Quote Link to comment Share on other sites More sharing options...
Psycho Posted June 2, 2008 Share Posted June 2, 2008 After I fixed the problems I already described I did not get any errors on the lines you showed above. I then rec'd an error on the last line of the javascript (i.e. the null). Since I do not have access to the external script being called I can't determine if the error is in this code or what is being returned from the external code. Quote Link to comment Share on other sites More sharing options...
GB_001 Posted June 2, 2008 Author Share Posted June 2, 2008 Thankyou, But the external code, isn't the problem since I tried substituting it with something else. Quote Link to comment Share on other sites More sharing options...
Psycho Posted June 3, 2008 Share Posted June 3, 2008 Nevertheless, I still get errors on different lines than you state above. I get the following errors: Line 33: ajaxDisplay.innerHTML = ajaxRequest.responseText; 'null' is null or not an object Line 48: ajaxRequest.send(null); The system cannot locate the resource specified So, I have to assume that the errors you are getting are different because of the external code. That's not to say there is a problem with the external code, just that it is difficult to properly debug without it. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.