Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript
|
Javascript General Javascript discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 6th, 2003, 11:23 AM
Authorized User
 
Join Date: Jul 2003
Posts: 46
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to stalker Send a message via MSN to stalker
Default PLEASE HELP! ACTIVEX in JScript

HI! I develop sites for fun but this one is a bit complex and I need help for a fancy trick.

I have this list of links and I wanted them all to be checked for broken URL. I have the whole system set up and it works perfectly fine as long as I run it from:

http://localhost/animelist/main.html

if I use my own IP:

http://213.22.16.159/animelist/main.html

it wont run.. the problme is in this lines of code:

function checklink(id,address) {
    try {
        resposta = new ActiveXObject("Msxml2.XMLHTTP");
        resposta.open("GET",address,false);
        resposta.send();
        //bla bla
    }
    catch(e){
        if ((e.number & 0xFFFF)==70) {
            //error caused by IE permission
        }
        else {
            //error: server doesnt exist
        }
    }
}

this is a rather KISS function and I wanna keep it this simple! a lot of guy show me other code.. I really want this code to do the trick.. unfortunatly i discovered that the error was the #70 meaning premission denied.. I changed my IE security permissions to LOWEST level and it worked.. unfortunatly I want it to work with MEDIUM level.

Can anyone help me or at least tell me why this component can't be loaded?

I've tried ActiveXObject("Microsoft.XMLHTTP"); and it works exctaly the same way..

Why doesn't this control even ASK to be runt?! it simple doesnt work when security is medium! is there any MINOR change to this script that will put it to work?

THANK YOU VERY MUCH FOR YOUR HELP! I really believe you guys are top webprogrammers and may help me :)

Pedro Duarte
#Portugal

 
Old August 14th, 2003, 04:27 AM
Registered User
 
Join Date: Aug 2003
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I'm not sure but could it be that the specific IP address (213.22.16.159) is that specified by your ISP for their domain (external to your computer). 'localhost' is part of your computer's domain. Therefore trying to access your computer via its external internet address is violating the browser's cross-domain security.
 
Old August 15th, 2003, 05:04 PM
Authorized User
 
Join Date: Jul 2003
Posts: 46
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to stalker Send a message via MSN to stalker
Default

Hi!

Thank you a lot!
I had already figured out what the problem was but I forgot to post it! thank you a lot anyway :)

What happens is that my Internet Explorer (and your too) default Security Options are set to allow access to other domains only in the Intranet. If you check the security settings in the Internet section it is disabled. That's why I was receiving this error (#70).

So I put a try...catch... statement checking the error and returning the a msg explaining this situation in case a #70 was returned.

Hope this topic may help ppl out! Thx a lot again!

HA! by the way! I'm only 20 but I am in conversation with a company to edit my own book on Web Development.. In portuguese of course! hehe I couldn't compete with WROX :)

Love you WROX! hehe

See ya and thx!






Similar Threads
Thread Thread Starter Forum Replies Last Post
ActiveX : getting PARAM value in activeX src smaraux Visual Studio 2005 1 March 4th, 2008 12:31 PM
Advantages /Disadvantages of ActiveX DLL & ActiveX priyank Beginning VB 6 6 February 19th, 2007 11:34 AM
JScript DumAss HTML Code Clinic 1 August 25th, 2004 02:46 AM
JScript Des67 Javascript 1 July 28th, 2003 05:05 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.