473,769 Members | 7,375 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Trouble executing ActiveXObject from server

Don
I'm trying to run the following page on my desktop from my host
server. It works just fine if I run it from my desktop, but not if I
run it from the server. I get "Error: Permission denied" on the
"newActiveXObje ct" statement. I understand about the security issues
surrounding ActiveX, but since I'm not accessinig any client-side
files, I would think this should work. Any ideas would be
appreciated.

Thanks,
Don
<html>
<head>
<title>Test Script</title>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1">
</head>
<body>
<script type="text/javascript">
//
// Get CPC index page 1
//
var sCPCIndexPage1U RL = "http://www.google.com" ;
var xmlhttp = new ActiveXObject(" Microsoft.XMLHT TP");
xmlhttp.open("G et",sCPCIndexPa ge1URL,false);
xmlhttp.send();
var sCPCIndexPage1H TML = xmlhttp.respons eText;
//
// Display page
//
window.open("ja vascript:opener .sCPCIndexPage1 HTML");
</script>
</body>
</html>

-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----== Over 100,000 Newsgroups - 19 Different Servers! =-----
Jul 23 '05 #1
9 5181


Don wrote:
I'm trying to run the following page on my desktop from my host
server. It works just fine if I run it from my desktop, but not if I
run it from the server. I get "Error: Permission denied" on the
"newActiveXObje ct" statement. I understand about the security issues
surrounding ActiveX, but since I'm not accessinig any client-side
files, I would think this should work. Any ideas would be var sCPCIndexPage1U RL = "http://www.google.com" ;
var xmlhttp = new ActiveXObject(" Microsoft.XMLHT TP");
xmlhttp.open("G et",sCPCIndexPa ge1URL,false);


I don't think you get permission denied for ActiveXObject, you should
get it for the open call trying to open a connection to
http://www.google.com/ as that is something the same origin policy
doesn't allow.
It works with local files as there IE doesn't implement the same origin
policy.
--

Martin Honnen
http://JavaScript.FAQTs.com/
Jul 23 '05 #2
Don
On Wed, 22 Sep 2004 17:13:10 +0200, Martin Honnen <ma*******@yaho o.de>
wrote:


Don wrote:
I'm trying to run the following page on my desktop from my host
server. It works just fine if I run it from my desktop, but not if I
run it from the server. I get "Error: Permission denied" on the
"newActiveXObje ct" statement. I understand about the security issues
surrounding ActiveX, but since I'm not accessinig any client-side
files, I would think this should work. Any ideas would be

var sCPCIndexPage1U RL = "http://www.google.com" ;
var xmlhttp = new ActiveXObject(" Microsoft.XMLHT TP");
xmlhttp.open("G et",sCPCIndexPa ge1URL,false);


I don't think you get permission denied for ActiveXObject, you should
get it for the open call trying to open a connection to
http://www.google.com/ as that is something the same origin policy
doesn't allow.
It works with local files as there IE doesn't implement the same origin
policy.

Hi Martin,

Any idea how I can do this?

Regards,
Don
-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----== Over 100,000 Newsgroups - 19 Different Servers! =-----
Jul 23 '05 #3


Don wrote:

[cross domain XML access]
Any idea how I can do this?


If it is just for your own purpose I think there is an IE preference you
can set on your IE browser, check the preferences, there should be
something like allow data access to sources from different domains.
If you want to do that in your web page when it is loaded in IE when
someone is visiting your site then that is not possible with client side
script, you would need server side scripting.
You can also try to write an HTML application (.hta file) if all you
want is implement the Google access for your own tests.
--

Martin Honnen
http://JavaScript.FAQTs.com/
Jul 23 '05 #4
Don
On Wed, 22 Sep 2004 17:44:23 +0200, Martin Honnen <ma*******@yaho o.de>
wrote:


Don wrote:

[cross domain XML access]
Any idea how I can do this?


If it is just for your own purpose I think there is an IE preference you
can set on your IE browser, check the preferences, there should be
something like allow data access to sources from different domains.
If you want to do that in your web page when it is loaded in IE when
someone is visiting your site then that is not possible with client side
script, you would need server side scripting.
You can also try to write an HTML application (.hta file) if all you
want is implement the Google access for your own tests.

My plan is to run the script on server side. I've tried it there, but
that's when I get the error. How can I run it on server side and not
get the error?

Don
-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----== Over 100,000 Newsgroups - 19 Different Servers! =-----
Jul 23 '05 #5


Don wrote:

[cross domain XML access]
My plan is to run the script on server side. I've tried it there, but
that's when I get the error. How can I run it on server side and not
get the error?


Do you have support for ASP scripting on your server? Otherwise you
can't run the code on the server.
On the server you should use code alike
<%@ Language="JScri pt" %>
<%
var httpRequest;
httpRequest = Server.CreateOb ject('Msxml2.Se rverXMLHTTP.3.0 ');
httpRequest.ope n('GET', 'http://www.google.com/', false);
httpRequest.sen d(null);
Response.Write( Server.HTMLEnco de(httpRequest. responseText));
%>

--

Martin Honnen
http://JavaScript.FAQTs.com/
Jul 23 '05 #6
Don
On Fri, 24 Sep 2004 15:38:33 +0200, Martin Honnen <ma*******@yaho o.de>
wrote:


Don wrote:

[cross domain XML access]

My plan is to run the script on server side. I've tried it there, but
that's when I get the error. How can I run it on server side and not
get the error?


Do you have support for ASP scripting on your server? Otherwise you
can't run the code on the server.
On the server you should use code alike
<%@ Language="JScri pt" %>
<%
var httpRequest;
httpRequest = Server.CreateOb ject('Msxml2.Se rverXMLHTTP.3.0 ');
httpRequest.op en('GET', 'http://www.google.com/', false);
httpRequest.se nd(null);
Response.Write (Server.HTMLEnc ode(httpRequest .responseText)) ;
%>


I'm going to run the script from the server, and not on the server.
It will be embedded in a web page, and be accessed by the client's
browser, like any other web site. It's just that when I run it from
the server I get that Error: Permission Denied.

Don
-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----== Over 100,000 Newsgroups - 19 Different Servers! =-----
Jul 23 '05 #7
In article <32************ *************** *****@4ax.com>,
Don <no@adr.com> wrote:
I'm going to run the script from the server, and not on the server.
It will be embedded in a web page, and be accessed by the client's
browser, like any other web site. It's just that when I run it from
the server I get that Error: Permission Denied.

Don


Because when you run a script from a server, the permissions get
lowered. If you want to take the risk on your machine, you can set the
permission lower.

You may also be able to change the file type to hta but this is a guess
because I am not knowledge about hta.

I assume you are using IE. I avoid using IE because I do not like its
security model.

What folks are saying is that if you want your web page to run on the
Internet on any browser, you need to move the functions that jump out of
your web page and interact with the native machine on to a server.

Robert
Jul 23 '05 #8


Don wrote:

[cross domain XML access]
I'm going to run the script from the server, and not on the server.
It will be embedded in a web page, and be accessed by the client's
browser, like any other web site. It's just that when I run it from
the server I get that Error: Permission Denied.


Yes, and I have explained that browsers implement a same origin policy
so your script loaded from http://host1.example.com/ can only use Msxml
to load data from that domain http://host1.example.com/ and not from
other domains.

--

Martin Honnen
http://JavaScript.FAQTs.com/
Jul 23 '05 #9
Don
On Sat, 25 Sep 2004 12:17:41 +0200, Martin Honnen <ma*******@yaho o.de>
wrote:


Don wrote:

>[cross domain XML access]

I'm going to run the script from the server, and not on the server.
It will be embedded in a web page, and be accessed by the client's
browser, like any other web site. It's just that when I run it from
the server I get that Error: Permission Denied.


Yes, and I have explained that browsers implement a same origin policy
so your script loaded from http://host1.example.com/ can only use Msxml
to load data from that domain http://host1.example.com/ and not from
other domains.

Hi Martin,

Thanks for that clarification. I think I understand now.

What construct would you recommend I use instead of Msxml?
Thanks, Don
-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----== Over 100,000 Newsgroups - 19 Different Servers! =-----
Jul 23 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1395
by: kmunderwood | last post by:
I am having trouble excluding select xml out to HTML using xsl I want to ignore some xml and turn others red I can not find the right way to both: 1. Only show the <tag> that want to, and 2. Turn an attribute a color when it falls below a certain level.
2
8483
by: Marcin Zmyslowski | last post by:
Hello all! I have installed MSDE on my local computer - Windows 2000 Professional. I have created a function which runs me a link whose path is placed in the input field. This function looks like this: function runCommand(zmienna) { if (zmienna==-1) {
4
10676
by: Andrew Hilton | last post by:
When you create an object in classic asp code, should you always use Server.CreateObject("ProgID")? Are there implications with stability (ie memory leaks) if you create COM objects in other ways in IIS? We use Javascript for our ASP coding, using a mixture of Server.CreateObject() and new ActiveXObject(). The web server hangs occasionally (once every 2-3 months) and we were wondering if this might be the culprit... Thanks!
2
1749
by: Jon Slaughter | last post by:
When a user clicks a link I have it open up a file in a div using ajax. my code is <a href="#Find" onclick="javascript:jah('Find.html','content');">Find</a><br /> Where Find.html is an html file on the server. Now when I do this everything works fine except php code is not being executed.
13
2537
by: mowsen | last post by:
Hello Group, i'm using a little "ajax" loader script to dynamically load files into different "div" tags on my main site. the code for this part looks like: function loader() { var args = loader.arguments; switch (args) { case
7
6732
by: RawMustard | last post by:
Hi Folks, my first post here. Sorry to start with a request. I'm having trouble executing python scripts compiled to byte code on ubuntu feisty server version. Basically I can type ./MyScript.py and the script runs fine but if I compile the script and type ./MyScript.pyc it won't run, I just get some junk characters printed to my terminal that mean nothing. Now if I type python MyScript.pyc it runs fine. I guess it's a path thing, but...
2
2450
by: gradinafrica | last post by:
I'm trying to create a log out button that uses AJAX to call a php file which ends the current session: //logout.php <?php if (!session_start()); session_destroy(); //Destroys the session echo "success"; ?>
5
13379
matheussousuke
by: matheussousuke | last post by:
Hello, I'm using tiny MCE plugin on my oscommerce and it is inserting my website URL when I use insert image function in the emails. The goal is: Make it send the email with the URL http://mghospedagem.com/images/controlpanel.jpg instead of http://mghospedagem.comhttp://mghospedagem.com/images/controlpanel.jpg As u see, there's the website URL before the image URL.
0
9589
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10049
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9997
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9865
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8873
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7413
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5448
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3965
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2815
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.