473,885 Members | 2,468 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Ajax IE 7 and Vista

Hello,

I posted a thread a couple of days back RE using Ajax with JS to read
an XML file. This isn't working form me in IE 7 and Vista:

xmlhttp = new XMLHttpRequest( );

xmlhttp.open("G ET", url);

where url is a file on my local disk. This works in FireFox, and in
Safari but not IE. IE returns an "Access denied" error when trying to
access the file. This will not be a problem when it's deployed as it
will be reading a file from the server but this is messing up my
testing - anyone know how to configure IE security etc. to allow this?
I've tried usual things but all failing.

Ta

Ray
Dec 22 '07 #1
8 1429
rbrowning1958 wrote:
I posted a thread a couple of days back RE using Ajax with JS to read
an XML file.
If it was only a couple of days back then it would have been appropriate to
simply continue that thread you are referring to.
This isn't working form me in IE 7 and Vista:

xmlhttp = new XMLHttpRequest( );

xmlhttp.open("G ET", url);

where url is a file on my local disk. This works in FireFox, and in
Safari but not IE. IE returns an "Access denied" error when trying to
access the file.
Probably due to the MSXML's equivalent of the Same Origin Policy. As you do
not show the value of `url', let alone state the line in which the error
occurs, one can only make that educated guess.

http://www.jibbering.com/faq/faq_not...ml#ps1DontWork
This will not be a problem when it's deployed as it will be reading a
file from the server but this is messing up my testing -
Please be more specific about what you are doing.
anyone know how to configure IE security etc. to allow this?
I don't think that is possible. However, a local Web server for testing
would probably help here and it is a good idea anyway.
I've tried usual things but all failing.
That is a useless statement. What do you consider "the usual things"?
PointedEars
--
Prototype.js was written by people who don't know javascript for people
who don't know javascript. People who don't know javascript are not
the best source of advice on designing systems that use javascript.
-- Richard Cornford, cljs, <f8************ *******@news.de mon.co.uk>
Dec 22 '07 #2
On Dec 22, 4:54*pm, Thomas 'PointedEars' Lahn <PointedE...@we b.de>
wrote:
rbrowning1958wr ote:
I posted a thread a couple of days back RE using Ajax with JS to read
an XML file.

If it was only a couple of days back then it would have been appropriate to
simply continue that thread you are referring to.
This isn't working form me in IE 7 and Vista:
* xmlhttp = new XMLHttpRequest( );
* xmlhttp.open("G ET", url);
where url is a file on my local disk. This works in FireFox, and in
Safari but not IE. IE returns an "Access denied" error when trying to
access the file.

Probably due to the MSXML's equivalent of the Same Origin Policy. *As you do
not show the value of `url', let alone state the line in which the error
occurs, one can only make that educated guess.

http://www.jibbering.com/faq/faq_not...ml#ps1DontWork
This will not be a problem when it's deployed as it will be reading a
file from the server but this is messing up my testing -

Please be more specific about what you are doing.
anyone know how to configure IE security etc. to allow this?

I don't think that is possible. *However, a local Web server for testing
would probably help here and it is a good idea anyway.
I've tried usual things but all failing.

That is a useless statement. *What do you consider "the usual things"?

PointedEars
--
Prototype.js was written by people who don't knowjavascriptf or people
who don't knowjavascript. People who don't knowjavascripta re not
the best source of advice on designing systems that usejavascript.
* -- Richard Cornford, cljs, <f806at$ail$1$8 300d...@news.de mon.co.uk>
Hello PointedEars - cute name!

Thank you for taking the time to reply. I'll be more precise.
I didn't continue the original thread cos I fixed the errors I was
having there and narrowed it down to this simple stand alone problem.

I don't see how having the value of url or the line number will help
but seeing as you asked url is "xml/images.xml" and it's on line 28 in
my Javascript lol. It is an html file containing the javascript. It is
reading this XML file. I know it's failing on that line cos an alert
right after it never gets shown and IE reports the access deined error
if I tell it to report all errors in script. I am testing this
locally. When I get around to deploying it it will be on a Web server
which will have rights set up to allow access to the files on the
webserver. This for local testing.

By usual things I meant ensuring IE could run scripts, and that rights
for the folder were set to allow all access. I'll read up on same
origin policy - new to me. In fact all this is new to me. The I think
it's an IE security issue is cos it works fine in FireFox and Safari.
Just IE.

Thanks for taking the time to reply.
Ray
Dec 22 '07 #3
Ed
On Dec 22, 11:52*am, rbrowning1958 <RBrowning1...@ gmail.comwrote:
I don't see how having the value of url or the line number will help
but seeing as you asked url is "xml/images.xml" and it's on line 28 in
my Javascript lol. It is an html file containing the javascript. It is
reading this XML file. I know it's failing on that line cos an alert
right after it never gets shown and IE reports the access deined error
if I tell it to report all errors in script. I am testing this
locally. When I get around to deploying it it will be on a Web server
which will have rights set up to allow access to the files on the
webserver. This for local testing.
I think you are seeing the problem described here:

http://dev.jquery.com/ticket/963
Dec 22 '07 #4
rbrowning1958 wrote:
I didn't continue the original thread cos I fixed the errors I was having
there and narrowed it down to this simple stand alone problem.
If there was no relationship to that thread at all, then referring to that
thread would not make sense either. You would not expect people to look it
up, now would you?
I don't see how having the value of url or the line number will help but
seeing as you asked url is "xml/images.xml" and it's on line 28 in my
Javascript lol. It is an html file containing the javascript. It is
reading this XML file. I know it's failing on that line cos an alert
right after it never gets shown and IE reports the access deined error if
I tell it to report all errors in script.
You should make improvements on the overall style of your postings if you
wish to be taken seriously in Usenet any further. This is _not_ chit-chat,
but a technical discussion which purpose is not only to analyze and solve
your problem (in the best possible way) but also to provide a learning
experience for other subscribers.

That includes, but is not limited to, *proper* quoting:

http://www.jibbering.com/faq/faq_notes/clj_posts.html
I am testing this locally. When I get around to deploying it it will be
on a Web server which will have rights set up to allow access to the
files on the webserver. This for local testing.
As I have said, you should set up a local test Web server so you can
reproduce the conditions on your remote production Web server. The file
system and HTTP are not equivalent, and if Ed's assumption is correct then
that would be exactly the cause of your problem.
PointedEars
--
Prototype.js was written by people who don't know javascript for people
who don't know javascript. People who don't know javascript are not
the best source of advice on designing systems that use javascript.
-- Richard Cornford, cljs, <f8************ *******@news.de mon.co.uk>
Dec 22 '07 #5
On Dec 22, 7:55*pm, Thomas 'PointedEars' Lahn <PointedE...@we b.de>
wrote:
rbrowning1958wr ote:
I didn't continue the original thread cos I fixed the errors I was having
there and narrowed it down to this simple stand alone problem.

If there was no relationship to that thread at all, then referring to that
thread would not make sense either. *You would not expect people to lookit
up, now would you?
I don't see how having the value of url or the line number will help but
seeing as you asked url is "xml/images.xml" and it's on line 28 in my
Javascriptlol. It is an html file containing thejavascript. It is
reading this XML file. I know it's failing on that line cos an alert
right after it never gets shown and IE reports the access deined error if
I tell it to report all errors in script.

You should make improvements on the overall style of your postings if you
wish to be taken seriously in Usenet any further. *This is _not_ chit-chat,
but a technical discussion which purpose is not only to analyze and solve
your problem (in the best possible way) but also to provide a learning
experience for other subscribers.

That includes, but is not limited to, *proper* quoting:

http://www.jibbering.com/faq/faq_notes/clj_posts.html
I am testing this locally. When I get around to deploying it it will be
on a Web server which will have rights set up to allow access to the
files on the webserver. This for local testing.

As I have said, you should set up a local test Web server so you can
reproduce the conditions on your remote production Web server. *The file
system and HTTP are not equivalent, and if Ed's assumption is correct then
that would be exactly the cause of your problem.

PointedEars
--
Prototype.js was written by people who don't knowjavascriptf or people
who don't knowjavascript. People who don't knowjavascripta re not
the best source of advice on designing systems that usejavascript.
* -- Richard Cornford, cljs, <f806at$ail$1$8 300d...@news.de mon.co.uk>
Hello Pointy ears,

In the interests of becoming a well behaved citizen - and having read
the FAQ you pointed me to I don't see the error of my ways. What
quoting did I do incorrectly? Do you think I was chit chatting?

Thanks for your time

Ray
Dec 22 '07 #6
On Dec 22, 7:06*pm, Ed <e...@siliconfo rks.comwrote:
On Dec 22, 11:52*am,rbrown ing1958<RBrowni ng1...@gmail.co mwrote:
I don't see how having the value of url or the line number will help
but seeing as you asked url is "xml/images.xml" and it's on line 28 in
myJavascriptlol . It is an html file containing thejavascript. It is
reading this XML file. I know it's failing on that line cos an alert
right after it never gets shown and IE reports the access deined error
if I tell it to report all errors in script. I am testing this
locally. When I get around to deploying it it will be on a Web server
which will have rights set up to allow access to the files on the
webserver. This for local testing.

I think you are seeing the problem described here:

*http://dev.jquery.com/ticket/963
Ed,

Spot on - thanks for that - it's allowed me to move forwards. I can
now read the file in both IE and FireFox - with IE using the Active X
(ActiveXObject( "Microsoft.XMLH TTP")) and with FireFox using
XMLHttpRequest( ).

I've now run into some other compatibility between the two versions.
Both versions correctly read the XML file; I call my own routine from
the onreadystatecha nge event when state is 4:

req.onreadystat echange =
function() {
if (req.readyState == 4) {
preloadSlidesho w(req);
}

So far so good and preloadSlidesho w does indeed get called. Here's the
first part of it:

function preloadSlidesho w(originalReque st) {
var slideshow = originalRequest .responseXML;
var slides = slideshow.getEl ementsByTagName ('slide');
alert(slides.le ngth.toString() );
alert(originalR equest.response Text);

Both browsers display the responseText showing the entire XML file -
so they have both read it. The problem now is IE reports the number of
slide elements as 0, firefox correctly as 5. Is this another know bug?
Here's part of the XML file:

<slideshow>
<slide>
<image>images/slides/0013_arboretum_ redbud.jpg</image>
<alttext>Phot o: A very pretty picture</alttext>
<link>http://www.ucdavis.edu/about/</link>
<caption>A very pretty picture</caption>
<more>Scenes of UC Davis</more>
</slide>
<slide>
<image>images/slides/0016_aggie_band _trumpet.jpg</image>
<alttext>Phot o: The Band-uh up close and personal</alttext>
<link>http://www.ucdavis.edu/sports_rec/</link>
<caption>The Band-uh up close and personal</caption>
<more>Scenes of UC Davis</more>
</slide>
...more here
</slideshow>

A bit frustrating all this!

Cheers

Ray
Dec 22 '07 #7
rbrowning1958 wrote:
function preloadSlidesho w(originalReque st) {
var slideshow = originalRequest .responseXML;
var slides = slideshow.getEl ementsByTagName ('slide');
alert(slides.le ngth.toString() );
alert(originalR equest.response Text);

Both browsers display the responseText showing the entire XML file -
so they have both read it. The problem now is IE reports the number of
slide elements as 0, firefox correctly as 5. Is this another know bug?
Yes, it is. If you insist on using `file:' instead of `http:', you will
have to work around that with

var objXmlDoc = new ActiveXObject(" Microsoft.XMLDO M");
objXmlDoc.loadX ML(originalRequ est.responseTex t);
var slides = objXmlDoc.getEl ementsByTagName ("slide");

Unsurprisingly, setting up a local Web server, as I already recommended
twice, will also avoid that workaround.
PointedEars
--
Prototype.js was written by people who don't know javascript for people
who don't know javascript. People who don't know javascript are not
the best source of advice on designing systems that use javascript.
-- Richard Cornford, cljs, <f8************ *******@news.de mon.co.uk>
Dec 23 '07 #8
On Dec 23, 12:51*am, Thomas 'PointedEars' Lahn <PointedE...@we b.de>
wrote:
rbrowning1958wr ote:
function preloadSlidesho w(originalReque st) {
* *var slideshow = originalRequest .responseXML;
* *var slides = slideshow.getEl ementsByTagName ('slide');
* *alert(slides.l ength.toString( ));
* *alert(original Request.respons eText);
Both browsers display the responseText showing the entire XML file -
so they have both read it. The problem now is IE reports the number of
slide elements as 0, firefox correctly as 5. Is this another know bug?

Yes, it is. *If you insist on using `file:' instead of `http:', you will
have to work around that with

* var objXmlDoc = new ActiveXObject(" Microsoft.XMLDO M");
* objXmlDoc.loadX ML(originalRequ est.responseTex t);
* var slides = objXmlDoc.getEl ementsByTagName ("slide");

Unsurprisingly, setting up a local Web server, as I already recommended
twice, will also avoid that workaround.

PointedEars
--
Prototype.js was written by people who don't knowjavascriptf or people
who don't knowjavascript. People who don't knowjavascripta re not
the best source of advice on designing systems that usejavascript.
* -- Richard Cornford, cljs, <f806at$ail$1$8 300d...@news.de mon.co.uk>
Thanks for that. I'm not understanding what the code is doing if i'm
not specifiying File: or http: as part of the url. My code just calls
the get with a string for the file name, such as "xml/test.xml". If I
just run this HTML by opening it in IE (or actually from within
Dreamweaver as I'm doing) I suppose it is using file:. If I put this
within a virtual folder within IIS and then reference it using
localhost or whatever it is is this going to use http:? I'm think I'm
missing the difference here. Regardless it's still a shame that this
doesn't work the same way.

Thanks again for taking the tiem to reply - and I ack your other reply
RE toString(). I can't see it making any difference really except it
saves me typing it - I assume alert just calls toString() for all not
character data.

Cheers

Ray
Dec 23 '07 #9

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

Similar topics

3
3685
by: David Prentice | last post by:
I am having dificulty debugging an ASP.NET Ajax (Novemver CTP) app on windows vista RTM. I have found the following interesting facts but cannot join the dots . . If my application is configured to run in the Classic .NET App pool, when I hit F5 in visual Studio 2005 I can successfully debug my application, however partial rendering using an update panel does not work (I have discovered that the script resource handler is causing a...
4
1300
by: www.gerardvignes.com | last post by:
I'd like to join or start a small group of Ajax web developers who are willing to smoke test each others Ajax applications, quid pro quo. I can smoke test on W2K SP4 with IE6, FF2, SM 1 and O9. I need the following smoke tests: IE7 on XP (are they SP1 or SP2 now?) IE and FF on VISTA (any SPs yet?) SAF, IE and FF on MAC (Panther, Tiger, ...?) KON and FF on LINUX (Debian, Ubuntu, ...?)
9
1887
by: =?Utf-8?B?SGFyZHkgV2FuZw==?= | last post by:
Hi all, I followed first walk through sample from http://ajax.asp.net/docs/tutorials/IntroductionUpdatePanel.aspx to create my first testing page, The problem is after I clicked that botton, it still trigged a postback. Do I miss something? Following is my code: <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
4
6500
by: NOTICIAS | last post by:
Hi everybody. A very basic web page using an ScriptManager and a RoundedCornersExtender fails loading at a shared hosting environment. In my local server, such page loads correctly. I'm almost sure that a wrong web.config is the reason. The site is hosted at Brinkster and they say they don't have a web.config
0
3292
by: Jobs | last post by:
C# , SQL Server , Vista , Ajax Interview questions links Full eBook with Vista , Ajax , SQL Server , UML and Architecture interview questions http://www.questpond.com/SampleInterviewQuestionBook.zip Marks good list of Interview questions
13
2059
by: Karl | last post by:
Hi all. I've recently rebuilt my Vista Ultimate workstation with Visual Studio Team Developer edition. Ive also put on the SQL Server 2005 tools and it's fully patched. I was building a web application in VS before the rebuild and I've just come to do some work on it, and it has reminded me that I need to install Ajax 1.0 again as I haven't done it yet (Ajax was installed before and the site makes use of it) but when I go to install it
5
13934
by: Sommer.pde | last post by:
It took me some time to find out when and why this happens. When the window of Internet Explorer is closed with an AJAX call still pending, something funny happens. Do it twice, and you will have to restart the browser. Here a little sample: http://truefriendz.de/iedos The script on this site will open 5 test-windows one at a time.
2
2762
by: =?Utf-8?B?c3Bw?= | last post by:
I have an ASP.NET AJAX WebApp with an Menu on master page. This menu has 4*5 items, every one with an image (small png files). Every time I browse a page in Visual Studio it takes about 5 minutes to load. During load on status bar appears "Downloading picture http://localhost:49887/webapp/webresource.axd?d=xX.........." or http://localhost:49887/webapp/images/oneimage.png
1
1170
by: dotpranay | last post by:
I have developed a web app using ajax, it working fine in Win 2003 and also Win XP. But on Vista, the app is behaving weirdly, in some vista machines the app is not doing partial postback, in other machines it works fine. On a vista machine that could not run the app, on disabling "Protected Mode" in the IE, the app started working. But in other vista machines, even with the Protected Mode enabled, the app is working fine..... Could...
0
9799
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
11172
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10871
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
10427
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
7139
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5808
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
6010
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4627
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
2
4235
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.