473,581 Members | 2,204 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

IE 6 Bug - Is DHTML Becoming Too Powerful? Cross-domain scripting not allowed

2 New Member
Hello,
I really believe that IE 6 has a new (intentional?) bug that severely limits the capability of dhtml and cross domain scripting. Yesterday, I read an interesting article about the subject and it only supported my claim. The article explained why Microsoft will not be letting the IE DHTML Implementation get any more powerful than it already is. Microsoft has realized that an experienced DHTML developer can create a web application that looks and performs just like a desktop application. It doesn't take a rocket scientist to realize the impact that this will have on the sales of Microsoft's new Core Development Products and Technologies (WinForms, C#, .net).

After I read this article, I started to think about an .hta script that suddenly quit working when I upgraded from IE 5 to IE 6. The script used cross domain techniques but nothing really fancy. To make matters worse, I have tried extensively to update and fix my script with no luck. I still receive 'Access Denied' errors.

If you are interested, I have prepared a simple code example containing a dhtml 'one-liner' which demonstrates the cross domain scripting technique that I have been ranting about. To use the example, save the code to a file with the .hta extension. Double click the .hta file to execute it. The application is very simple. Select some text with your mouse and click the 'Get HTML' button. The button is suppose to (and did under IE 5) pop up an alert message that contains the HTML snippet which corresponds to your selection. To try and fix the script, I added the application="ye s" attribute to the IFRAME Tag. According to the documentation, this is a new requirement for IE 6. It is suppose to lower the security constraints for the iframe, thus enabling cross domain scripting. It didn't work. Do take note that the example works when the html file in the iframe is on your local machine (example- change the 'src' attribute of the iframe to 'c:\file.htm' or something).

Code Example:
[HTML]<html>
<head>
<TITLE>Simple Cross Domain DHTML Mouse Selection Script</TITLE>
<HTA:APPLICATIO N ID="HTAEx"
APPLICATIONNAME ="HTAEx"
ICON="e.ico"
WINDOWSTATE="no rmal">
</head>
<body>
<input type="button" value="Get HTML" onClick="getTex t()"><br><span> <br>
<iframe Application="ye s" src="http://msdn.microsoft. com" id="TheFrame" style="width: 100%; height: 85%"></iframe>
<script language=JScrip t>
function getText()
{
var doc = window.frames.T heFrame.documen t;
var text1 = doc.selection.c reateRange().ht mlText;
alert(text1);
}
</script>
</body>
</html>[/HTML]

Let me know what you think.
Oct 8 '06 #1
3 2522
acoder
16,027 Recognized Expert Moderator MVP
Conspiracy theories, don't you just love 'em? ;)

JavaScript doesn't allow cross-domain access unless in reduced security, e.g. "file:" or when granted privileges. You can use Ajax which allows server-side code to be run without reloading the page - now that's a lot more powerful than DHTML!
May 19 '08 #2
gits
5,390 Recognized Expert Moderator Expert
hi ...

there are some common and known issues with cross-domain-requests and at this moment it is 'good' that JavaScript doesn't allow that ... but on the other hand you are limited in creating mashups and something like this and you have to make server-turn-arounds to achieve this with serverside request proxies etc. ... here is an interesting read about that ... which in short describes an idea where the developer could give permission to a cross-domain-request ... i think that would be a quite good solution for the need that often appears with that issue ...

kind regards
May 19 '08 #3
acoder
16,027 Recognized Expert Moderator MVP
Another method of cross-domain access is by using JSON with dynamic script tags.
May 20 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

19
1792
by: Arthur | last post by:
Did I hallucinate something about __name__ becoming read-write? Not in alpha2. Can't find the reference to this I thought I read - that it was concluded to be necessary in connection with PEP318. Better get my facts straight first.... But if true that would seem to solve the main objection to:
3
5687
by: Thomas Kemetmüller | last post by:
Hi folks! I'm searching for a cross browser compatible DHTML popup calendar, there are plenty of those on the web, but I need one, which is absolutely free, very simple and good looking, do you have any favourites? Thanks! Thomas
1
2873
by: Catherine Lynn Smith | last post by:
OK, I know this issue has been beat to death, but I have tested my script in Netscape 7.1 and it does seem to be getting the calculated values it needs to create placement coordinates, and every example I can find that 'works' in my netscape browser "appears" to use the same style references to the various div objects that I am trying to use....
21
8475
by: Nik Coughlin | last post by:
Are there methods for manipulating images in JavaScript that would allow me to write functions to rotate, skew, mask and resize images (bitmaps)? The functions need to be fast enough for use in a top-down scrolling game. Or would I be better off preprocessing all of the images with something server side such as PHP and then preloading them...
6
1973
by: Terry | last post by:
Hi, I like the DHTML-based pop-up window script made available by this company. However, their script only works under the quirk mode for IE 6 and Firefox. http://www.ferant.com I wonder if there are other similar DHTML-based scripts that can do the same but is not limited to the quirk mode for IE 6.
3
1378
by: cjl | last post by:
Hey all: I'm stuck. I'm using the code from www.quirksmode.org for cross browser access to HTML elements, but I'm getting a javascript error. The relevant code: function getObj(name) { if (document.getElementById) {
2
3674
by: Questman | last post by:
Good afternoon, Does anyone have any code that implements, or approaches implementing, a cross-browser DHTML/JS solution to provide an Excel-like Grid on a web page - I'm trying to convert an old Java client/server data maintenance program to the web - the main display is in a grid format, which allows the user to select multiple rows and...
6
1207
by: petermichaux | last post by:
Hi, I've been thinking about unit testing DHTML widgets. Is the only real way to create small examples/test files and manually run each in a bunch of browsers? Thanks, Peter
0
7792
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...
0
8149
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. ...
0
8304
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...
1
7899
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...
0
8175
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...
0
6553
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...
0
5364
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...
0
3805
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...
1
2301
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

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.