Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Dec 4th, 2006, 6:15 AM   #1
anant_tickoo
Programmer
 
Join Date: Sep 2005
Posts: 50
Rep Power: 0 anant_tickoo is an unknown quantity at this point
not abl to retrive page by javascript

hey!!


i am trying to get this code running .. it works fine when i am open it localy that is i double click html file every thing goes okey ..
but when i request it form site eg. http://10.0.54.61. the error is that permisson denied and the page i request does no get displayed...


wot is wrong

kindly help
<HTML> 
<HEAD> 

<META HTTP-EQUIV=REFRESH CONTENT=60>
<base target="_self">
</HEAD>
<BODY>
<B><center>UPDATES</center></b>
 
<script type="text/javascript">
var req;
function getUrl(url) { 
    var req = new ActiveXObject("microsoft.xmlhttp"); 
        req.open("GET",url,false); //i see error here ::permission denied 
        req.send(); 
    return req.responseText; 

} 

 req = getUrl('http://10.0.54.140');
document.write(req);
</SCRIPT>

</BODY>
</HTML>
anant_tickoo is offline   Reply With Quote
Old Dec 4th, 2006, 6:34 AM   #2
Arevos
Programming Guru
 
Arevos's Avatar
 
Join Date: Aug 2005
Location: England
Posts: 1,499
Rep Power: 5 Arevos is on a distinguished road
As far as I know, XMLHttpRequest only lets you retrieve information from the local server as part of a security measure. If you want to retrieve information from a remote server you need some sort of proxy.

As an aside, your code is IE-specific. Okay for testing, but you'd have to change that for production use - just in case you didn't know.
Arevos is offline   Reply With Quote
Old Dec 4th, 2006, 10:24 AM   #3
anant_tickoo
Programmer
 
Join Date: Sep 2005
Posts: 50
Rep Power: 0 anant_tickoo is an unknown quantity at this point
i am using it for ie 6 only... are u sue abt the "XMLHttpRequest only lets you retrieve information "

w3 words
The XMLHttpRequest object is an interface exposed by a scripting engine that allows scripts to perform HTTP client functionality, such as submitting form data or loading data from a server.

Last edited by anant_tickoo; Dec 4th, 2006 at 10:37 AM.
anant_tickoo is offline   Reply With Quote
Old Dec 4th, 2006, 11:15 AM   #4
Pizentios
Programming Guru
 
Pizentios's Avatar
 
Join Date: May 2004
Location: Brandon, Manitoba, Canada
Posts: 2,023
Rep Power: 7 Pizentios is on a distinguished road
Send a message via ICQ to Pizentios Send a message via MSN to Pizentios
why not use a system call and wget? ofcourse, this will only work if your using something like php, as javascript is client side only.
__________________
Profanity is the one language that all programmers understand.

Check out my Blog <---updated Nov 30 2007!
Pizentios is offline   Reply With Quote
Old Dec 4th, 2006, 12:25 PM   #5
anant_tickoo
Programmer
 
Join Date: Sep 2005
Posts: 50
Rep Power: 0 anant_tickoo is an unknown quantity at this point
ya i am doing same but i get error permission denied. .. when below gets executed ....

req.open("GET",url,false); //i see error here ::permission denied



i do't understand that
anant_tickoo is offline   Reply With Quote
Old Dec 4th, 2006, 12:38 PM   #6
Arevos
Programming Guru
 
Arevos's Avatar
 
Join Date: Aug 2005
Location: England
Posts: 1,499
Rep Power: 5 Arevos is on a distinguished road
Quote:
Originally Posted by anant_tickoo View Post
i am using it for ie 6 only... are u sue abt the "XMLHttpRequest only lets you retrieve information "
It would help if you took the time to produce a vaguely coherent reply. If you expect people to spend some of their time giving you an answer, surely the least you can do is spend a few seconds making your post understandable.

In any case, yes, I'm fairly sure, assuming you meant "sure" rather than "sue" and "about" rather than "abt". See here.
Arevos is offline   Reply With Quote
Old Dec 5th, 2006, 9:06 AM   #7
anant_tickoo
Programmer
 
Join Date: Sep 2005
Posts: 50
Rep Power: 0 anant_tickoo is an unknown quantity at this point
thanks for that arevos .... i will work on your advice .. secondly.. i am here for hint .. not for some to work on my problems .
anant_tickoo is offline   Reply With Quote
Old Dec 7th, 2006, 5:51 AM   #8
BlackDal
Newbie
 
Join Date: Feb 2006
Posts: 12
Rep Power: 0 BlackDal is on a distinguished road
you can run this script code from your computer as "local file" but you can't run from "internet location"
because
1 : it's unsafe! are you sure the object xmlhttp from microsoft server exists on every computer??
2 : access from client-to-server by getting GET is denied

you want show other page in your page?

soultion:
1 : write a server side (or server run) script!
2 : use frame with src propety for showing other page
BlackDal is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Hidden unless Javascript enabled? Writlaus JavaScript and Client-Side Browser Scripting 3 Apr 25th, 2006 10:52 PM
HTML page not reading external Javascript file aznluvsmc JavaScript and Client-Side Browser Scripting 9 Nov 21st, 2005 9:17 PM
Page Replacement Program (C++) redhatter Existing Project Development 1 Nov 20th, 2005 10:38 AM
Handling new windows not created by JavaScript nwruiz JavaScript and Client-Side Browser Scripting 3 Jun 24th, 2005 9:03 PM
After execution - Error cannot locate /Skin File? wchar Visual Basic 1 Mar 5th, 2005 9:04 PM




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 2:43 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC