473,839 Members | 1,423 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

XMLHTTP

A nice way to dynamically update HTML on a page (without leaving the
page) is to use document.innerH TML and XMLHTTP in JavaScript, then
communicate with the server via XML snippets (plus some server side
scripts of course, I use PHP5+MySQL). If you want to see an example,
you can take a look at my chat:
http://blog.outer-court.com/chat/

(And I was inspired by Google Suggest, which uses XMLHTTP.)

Of course, this can also be used for form validation and similar tasks.
Jul 23 '05
50 4701


Lachlan Hunt wrote:
Do you realise that innerHTML is a non-standard function and it *does
not* work in X(HT)ML documents (when they are parsed as XML, rather than
tag-soup).


In recent Operas and in recent Mozilla 1.8 nightlies you can set
innerHTML of XHTML elements in XHTML documents parsed as XML. You can
also read it but I think only Opera 8 beta then produces well-formed
XHTML while Mozilla doesn't. But there is work on that done:
<https://bugzilla.mozill a.org/show_bug.cgi?id =133827>
<https://bugzilla.mozill a.org/show_bug.cgi?id =155723>

As that is rather off-topic in ciwah followup-to set to
comp.lang.javas cript.

--

Martin Honnen
http://JavaScript.FAQTs.com/
Jul 23 '05 #11
Lachlan Hunt wrote:
Philipp Lenssen wrote:
Lachlan Hunt wrote:

Philipp Lenssen wrote:

> A nice way to dynamically update HTML on a page (without
> leaving the page) is to use document.innerH TML and XMLHTTP in
> JavaScript

Do you realise that innerHTML is a non-standard function and it
*does not* work in X(HT)ML documents (when they are parsed as
XML, rather than tag-soup).


"innerHTML" works fine in at least Windows Firefox and IExplorer.


No, it doesn't. Try serving your document as application/xhtml+xml
to Firefox


Wait, I never serve my XHTML as "applicatio n/xhtml+xml" -- because
AFAIK that breaks IE.

--
Google Blogoscoped
http://blog.outer-court.com
Jul 23 '05 #12
Philipp Lenssen wrote:
Harlan Messinger wrote:
Philipp Lenssen wrote:
A nice way to dynamically update HTML on a page (without leaving the
page) is to use document.innerH TML and XMLHTTP in JavaScript, then
communicat e with the server via XML snippets (plus some server side
scripts of course, I use PHP5+MySQL). If you want to see an example,
you can take a look at my chat:
http://blog.outer-court.com/chat/ (And I was inspired by Google
Suggest, which uses XMLHTTP.)


That's fine for IE-specific limited-audience applications


No, it works in Firefox too.


Honestly??? I thought that Firefox was a cross-OS browser. I didn't
think its Javascript implementation would include Microsoft-specific
extras like ActiveX automation. Interesting.
Jul 23 '05 #13
Harlan Messinger wrote:
Philipp Lenssen wrote:
Harlan Messinger wrote:
Philipp Lenssen wrote:

> A nice way to dynamically update HTML on a page (without
> leaving the page) is to use document.innerH TML and XMLHTTP in
> JavaScript, then communicate with the server via XML snippets
> (plus some server side scripts of course, I use PHP5+MySQL). If
> you want to see an example, you can take a look at my chat:
> http://blog.outer-court.com/chat/ (And I was inspired by Google
> Suggest, which uses XMLHTTP.)

That's fine for IE-specific limited-audience applications


No, it works in Firefox too.


Honestly??? I thought that Firefox was a cross-OS browser. I didn't
think its Javascript implementation would include Microsoft-specific
extras like ActiveX automation. Interesting.


I guess they realized it was the only proprietary thing that made
sense. Didn't you often find yourself doing XML, and just wishing for
an easy-to-use "innerXML" function?

And yes, honestly. I always use Firefox, and the chat does work :)

--
Google Blogoscoped
http://blog.outer-court.com
Jul 23 '05 #14
Philipp Lenssen wrote:
Wait, I never serve my XHTML as "applicatio n/xhtml+xml" -- because
AFAIK that breaks IE.


Will you never serve it as such in the future?
Why are you using XHTML if you never serve it as such?

--
David Dorward <http://blog.dorward.me .uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is
Jul 23 '05 #15
Harlan Messinger wrote:
Honestly??? I thought that Firefox was a cross-OS browser. I didn't
think its Javascript implementation would include Microsoft-specific
extras like ActiveX automation.


The Firefox / Opera / Safari implementation of HttpRequest is not ActiveX
based.

http://jibbering.com/2002/4/httprequest.html
--
David Dorward <http://blog.dorward.me .uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is
Jul 23 '05 #16
Philipp Lenssen wrote:
Lachlan Hunt wrote:
Philipp Lenssen wrote:
"innerHTML " works fine in at least Windows Firefox and IExplorer.


No, it doesn't. Try serving your document as application/xhtml+xml
to Firefox


Wait, I never serve my XHTML as "applicatio n/xhtml+xml" -- because
AFAIK that breaks IE.


Then why use XHTML at all? If you're not going to use it properly, why
not just stick with HTML 4.01?

--
Lachlan Hunt
http://lachy.id.au/
http://GetFirefox.com/ Rediscover the Web
http://GetThunderbird.com/ Reclaim your Inbox
Jul 23 '05 #17
David Dorward wrote:
FAIK that breaks IE.

Will you never serve it as such in the future?
Why are you using XHTML if you never serve it as such?
David Dorward <http://blog.dorward.me .uk/>


Why do you?

I prefer XHTML for a variety of reasons. First of all because I prefer
XML-style syntax. Second of all because I can spit it out easier with
tools which spit out XML. Third, because it is more strict in its
validation, and I always preferred e.g. "<p>...</p>" to "<p>...", even
when latter was allowed in HTML4. Fourth, because it's the most recent
HTML suggestion by the W3C, and I like to tinker with what's good and
modern. 5th, because I don't see any downside to it, so I don't even
need any other reason than 1 to begin with...

--
Google Blogoscoped
http://blog.outer-court.com
Jul 23 '05 #18
Lachlan Hunt wrote:
Philipp Lenssen wrote:
Lachlan Hunt wrote:
Philipp Lenssen wrote:
> "innerHTML" works fine in at least Windows Firefox and
> IExplorer.

No, it doesn't. Try serving your document as
application/xhtml+xml to Firefox


Wait, I never serve my XHTML as "applicatio n/xhtml+xml" -- because
AFAIK that breaks IE.


Then why use XHTML at all? If you're not going to use it properly,
why not just stick with HTML 4.01?


(Just answered that in the same thread to another curious person...
it's great to see this newsgroup never changed...)

--
Google Blogoscoped
http://blog.outer-court.com
Jul 23 '05 #19
Philipp Lenssen wrote:
Why are you using XHTML if you never serve it as such?
Why do you?
1. I do serve it as such - my CMS is just broken at present so my insurance
against non-well-formed documents isn't in place.
2. The CMS which I used to use for that site spat out XHTML and, short of
hacking the source, wouldn't be persuaded to use HTML.
Third, because it is more strict in its validation
Interesting myth.

<a href="foo"><b>< a href="bar">foo</a></b></a>

That code fragment is valid in XHTML, but not in HTML.
, and I always preferred e.g. "<p>...</p>" to "<p>...", even
when latter was allowed in HTML4.
Nothing stopping you validating against a custom DTD that required end tag
on all non-empty elements (and then switching to a real HTML DTD for
publishing).
Fourth, because it's the most recent HTML suggestion by the W3C, and I
like to tinker with what's good and modern.
If you are going to count XHTML 1.0 as an HTML suggestion, then the more
recent is XHTML 1.1 - of course that "SHOULD NOT" be served as text/html at
all.
5th, because I don't see any downside to it, so I don't even
need any other reason than 1 to begin with...


How about ">" characters being rendered after every image, line break and
horizontal rule in browsers which get HTML right (like W3-mode)?

--
David Dorward <http://blog.dorward.me .uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is
Jul 23 '05 #20

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

Similar topics

9
5591
by: fochie | last post by:
Greetings, I'm having a problem when I try to GET a file from my server via xmlhttp when using Mozilla. With IE I can get any type of file fine, get/display headers fine, etc. With Mozilla, using the same HTML/JS it always returns no data (xmlhttp.responseText is null). When I try to get headers using Mozilla or display the http status code I get some obscure exception in the javascript console that I've given up on searching for an...
1
4939
by: Ike | last post by:
Ive copied an online example for writing out a php file, programmatically, then would like to re-display that data in a browswer window that automatically refreshes as the data file (getdata.php, which is the file I am programmatically rewriting to elsewhere) gets changed. I am trying to use AJAX and JSON to do this. I have copied an example of using HttpRequest Object as the backbone of this from...
5
2819
by: hatsumoto | last post by:
Hello, I create an ActiveXObject("Msxml2.XMLHTTP") from my HTML page to submit (i.e. post) XML to a server. I can see the content of the XML response via javascript alert(xmlhttp.responseText). Is there a way to display the content of xmlhttp.responseText on a new page?? I tried document.write(xmlhttp.responseText) but this does not display the XML structure.
9
2388
by: balakrishnan.dinesh | last post by:
hi friends, Exactly what i want to know is, In my product we are using xmlhttp request to retrive some data from the server, And Im using IE browser, its working fine in IE. Now i want to work with netscape,I dont know how to pass the xmlhttp request in Netscape. i got some code like below for netscape for xmlhttp var oXML=new XMLHttpRequest();
13
25388
by: yawnmoth | last post by:
<http://www.quirksmode.org/book/printable/xmlhttp.txtshows two alternatives to Microsoft.XMLHTTP - Msxml2.XMLHTTP and Msxml3.XMLHTTP. If my understanding is correct, the different numbers refer to the version of Microsoft's XML parser and that Microsoft.XMLHTTP refers to the latest installed version. This makes me wonder why sites like <http://developer.apple.com/internet/webcontent/xmlhttpreq.htmlopt to use Msxml2.XMLHTTP, first, and...
1
3858
by: wkerplunk | last post by:
Below is what I have build with several different languages. It works great but I need help, I am stuck. When you click on an item in the dropdown autocomplete div it does a mousedown function and send the item number to the xmlHttp and works awesome. Now I need to add an apply button next to it. so they can type in the complete number then hit apply and it does the same function. I cant get it to work with the script I have. The image...
3
2596
by: Andrewh | last post by:
Hi, I am having a bit of a problem with using xmlhttp. The code of the javascript file is shown below used in Windows XP. var xmlhttp = null; function SetURLDiv(url) { if (window.XMLHttpRequest) {
2
12477
by: trpost | last post by:
Is it possible to execute javascript as passed in xmlHttp.responseText Here is what I am doing: search.js var xmlHttp xmlHttp=GetXmlHttpObject() var url="search.php" xmlHttp.onreadystatechange=stateChanged
1
1501
by: StevenS | last post by:
Ok, I'm very new to AJAX programming, and fairly new to Javascript. (I was originally trained on low-level C programming.) I'm trying to build a simple AJAX routine in a file named ajax.js: var xmlReqs = new Array(); function CXMLHttp(cb,data,xmlHttp) { this.cb = cb; this.data = data; this.xmlhttp = xmlHttp; }
0
10911
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...
0
10589
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...
0
9429
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
7833
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
7021
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
5683
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
5867
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
4066
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3136
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.