neoaddict Posted May 7, 2006 Share Posted May 7, 2006 [code]<script type="text/javascript"><!-- function makeRequest(url) { var http_request = false; if (window.XMLHttpRequest) { http_request = new XMLHttpRequest(); } else if (window.ActiveXObject) { try { http_request = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { http_request = new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) {} } } if (!http_request) { alert('Your browser does not support AJAX or XMLHttpRequest!'); return false; } http_request.open('GET', url, true); if (url == "checkcookie.php") { http_request.onreadystatechange = parse; } http_request.send(null); } function parse() { if (http_request.readyState == 4) { if (http_request.status == 200) { var css = http_request.responseText; document.getElementById("topsites").style.display = css; } else{ alert('There was a problem with the request.'); } } open('checkcookie.php'); function omgmagic() { if(document.getElementById("topsites").style.display == 'none'){ makeRequest('show.php'); document.getElementById("topsites").style.display = ''; } else{ makeRequest('hide.php'); document.getElementById("topsites").style.display = 'none'; } }//--></script>[/code]Here are the errors that Firefox's Error Console keeps on giving me:[!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]Warning: function makeRequest does not always return a valueSource file: [a href=\"http://www.neo-addict.net/******/portal/\" target=\"_blank\"]http://www.neo-addict.net/******/portal/[/a]Line: 202, Column: 4Source code: } Error: missing } after function bodySource file: [a href=\"http://www.neo-addict.net/*******/portal/\" target=\"_blank\"]http://www.neo-addict.net/*******/portal/[/a]Line: 228, Column: 5Source code://--> Warning: function makeRequest does not always return a valueSource file: [a href=\"http://www.neo-addict.net/********/portal/\" target=\"_blank\"]http://www.neo-addict.net/********/portal/[/a]Line: 202, Column: 4Source code: } [/quote]Thanks very much! Quote Link to comment https://forums.phpfreaks.com/topic/9220-javascript-console-errors/ Share on other sites More sharing options...
neoaddict Posted May 7, 2006 Author Share Posted May 7, 2006 [code]<script type="text/javascript"><!-- function makeRequest(url) { var http_request = false; if (window.XMLHttpRequest) { http_request = new XMLHttpRequest(); } else if (window.ActiveXObject) { try { http_request = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { http_request = new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) {} } } if (!http_request) { alert('Your browser does not support AJAX or XMLHttpRequest!'); return false; } http_request.open('GET', url, true); if (url == "checkcookie.php") { http_request.onreadystatechange = parse; } http_request.send(null); } function parse() { if (http_request.readyState == 4) { if (http_request.status == 200) { var css = http_request.responseText; document.getElementById("topsites").style.display = css; } else{ alert('There was a problem with the request.'); } } } makeRequest('checkcookie.php'); function omgmagic() { if(document.getElementById("topsites").style.display == 'none'){ makeRequest('show.php'); document.getElementById("topsites").style.display = ''; } else{ makeRequest('hide.php'); document.getElementById("topsites").style.display = 'none'; } }//--></script>[/code]Fixed the parse error now.I don't know why it keeps on throwing up a [!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]Error: uncaught exception: Permission denied to call method XMLHttpRequest.open[/quote]when the file is not off-server... Quote Link to comment https://forums.phpfreaks.com/topic/9220-javascript-console-errors/#findComment-34079 Share on other sites More sharing options...
neoaddict Posted May 9, 2006 Author Share Posted May 9, 2006 Any ideas? Quote Link to comment https://forums.phpfreaks.com/topic/9220-javascript-console-errors/#findComment-34777 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.