AJAX preload webpage |
AJAX preload webpage |
Garfield |
Dec 13 2009, 05:34 AM
Post
#1
|
Group: Members Posts: 1 Joined: 13-December 09 Member No.: 10,569 |
Hi,
I'm trying to preload an external webpage to get its cookies for further use of the form that is on that webpage. Because you can not use the form without the cookies it must be done by AJAX! I wrote a little AJAX code that can do the job, but it does not work: In FF it gives no error but doesn't work and in IE it states: Webpage error details User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; OfficeLiveConnector.1.4; OfficeLivePatch.1.3) Timestamp: Sun, 13 Dec 2009 10:31:04 UTC Message: Toegang geweigerd. Line: 17 Char: 1 Code: 0 URI: http://mydomain.be/test.html This is the code: CODE <html> <head> <script type="text/javascript"> function ajaxDLP() { var xmlhttp; if (window.XMLHttpRequest) { // code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest(); } else { // code for IE6, IE5 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.open("GET","http://reisinfo.delijn.be/doorkomsten/DoorkomstenHome.faces",true); xmlhttp.send(null); } </script> </head> <body onload="ajaxDLP();"> <a href="http://reisinfo.delijn.be/doorkomsten/DoorkomstenHome.faces?form1:gemeenteInput=SINT-ANTONIUS%20(ZOERSEL)&form1:inDeBuurtVanRadio=adres&form1:straatInput=KERKHOFLEI&form1:nrInput=14&form1:dagCombo=13&form1:maandCombo=12&form1:jaarCombo=2009&form1:opzoekenButton=Zoeken&form1=form1" target="_blank">SINT-ANTONIUS (ZOERSEL) - KERKHOFLEI 14</a> </body> </html> I have permission from the webadmin to use the form using AJAX. Can anyone tell me what I'm doing wrong? |
Lo-Fi Version | Time is now: 17th April 2024 - 07:36 PM |