From: David Mark on
On Aug 1, 7:52 am, David Mark <dmark.cins...(a)gmail.com> wrote:
> On Aug 1, 6:15 am, Thomas 'PointedEars' Lahn <PointedE...(a)web.de>
> wrote:
>
> > David Mark wrote:
> > > jr wrote:
> > >> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
> > >> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
>
> > > Why are you using XHTML when IE doesn't support it?  Clearly you are
> > > relying on error correction to turn it into HTML.
>
> > That assumption cannot be made from the posting.
>
> LOL.  You really think this "jr" guy is using XML parse mode?
> Furthermore, on the entire Web, I know of exactly one document that
> creates an XHTML DOM.  My XHTML Build Test page.
>
> Again, what would be the point as IE (< 9) anyway does not support
> it.  It's been a dead issue almost from the start on the Web.
>
> Not only that, but you are flat-out wrong about the context of this
> posting.  The posted markup is not going to work in XML parse mode.
>

And neither would the script.

As is often the case with "XHTML" documents found on the Web, any hope
of "future proofing" (for a dead language no less) is lost due to
scripts that would never work reliably in XHTML DOM's.

To wit:-

var xhr = document.forms[0].search_zonenm.value
From: Richard Cornford on
Thomas 'PointedEars' Lahn" wrote:
> David Mark wrote:
>> jr wrote:
>>> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
>>> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
>>
>> Why are you using XHTML when IE doesn't support it? Clearly
>> you are relying on error correction to turn it into HTML.
>
> That assumption cannot be made from the posting.
<snip>

In the event that this document is being interpreted as XHTML by the
browser, the:-

| <input type="button" ... onClick="printFromHere();"/>
^^^^^^^
- in the mark-up is sufficient to explain why clicking the button is not
resulting in any apparent action.

However, that does suggest a reliance on the document being interpreted
as HTML (and so error corrected), but possibly a reliance that is
disappointed by the document actually being interpreted as XHTML.

Richard.

From: jr on
On Aug 1, 2:12 am, Denis McMahon <denis.m.f.mcma...(a)googlemail.com>
wrote:
> On 01/08/10 05:04, jr wrote:
>
> > <script type="text/javascript">
> > function printFromHere(){
>
> > var xhr = document.forms[0].search_zonenm.value;
> >                 if ( window.XMLHttpRequest ) {// code for IE7+,
> > Firefox, Chrome, Opera, Safari
> >              xhr=new XMLHttpRequest();
> >            }else{ // code for IE6, IE5
> >              xhr=new ActiveXObject("Microsoft.XMLHTTP");
> >            }
>
> What is the purpose of xhr in your code? Is it to hold the
> XMLHttpRequest object, or to hold the value of field
> document.forms[0].search_zonenm.value?
>
> See my earlier response to the original thread about this code for other
> issues.
>
> Rgds
>
> Denis McMahon
xhr is needed to check the value of the readystate, right?
I did change it from assigning the printer_response to the
responseText to the innerHTML of the getElementByID function. thanks,
document.getElementById('printer_response').innerHTML="Received:" +
xhr.responseText;
From: Denis McMahon on
On 01/08/10 16:20, jr wrote:
> On Aug 1, 2:12 am, Denis McMahon <denis.m.f.mcma...(a)googlemail.com>
> wrote:
>> On 01/08/10 05:04, jr wrote:
>>
>>> <script type="text/javascript">
>>> function printFromHere(){
>>
>>> var xhr = document.forms[0].search_zonenm.value;
>>> if ( window.XMLHttpRequest ) {// code for IE7+,
>>> Firefox, Chrome, Opera, Safari
>>> xhr=new XMLHttpRequest();
>>> }else{ // code for IE6, IE5
>>> xhr=new ActiveXObject("Microsoft.XMLHTTP");
>>> }
>>
>> What is the purpose of xhr in your code? Is it to hold the
>> XMLHttpRequest object, or to hold the value of field
>> document.forms[0].search_zonenm.value?
>>
>> See my earlier response to the original thread about this code for other
>> issues.

> xhr is needed to check the value of the readystate, right?
> I did change it from assigning the printer_response to the
> responseText to the innerHTML of the getElementByID function. thanks,
> document.getElementById('printer_response').innerHTML="Received:" +
> xhr.responseText;

An object to handle the data exchange is needed, yes, but it doesn't
have to be called any specific name.

Let me clarify my earlier question:

First you do this:

>>> var xhr = document.forms[0].search_zonenm.value;

which assigns some value from a form field to the variable "xhr"

Then you do this:

>>> if ( window.XMLHttpRequest ) { // IE7+ ff chrome etc
>>> xhr=new XMLHttpRequest();
>>> }else{ // IE6, IE5
>>> xhr=new ActiveXObject("Microsoft.XMLHTTP");
>>> }

which assigns your data exchange object to "xhr"

Now, which one of these two is xhr meant to be, and whichever one it is,
what is the correct name of the variable that you wish to assign to the
other one.

For all the regulars, how long before jr asks for help in working out
why xhr doesn't contain a string representing
"document.forms[0].search_zonenm.value"?

Rgds

Denis McMahon
From: Captain Paralytic on
On Aug 1, 12:52 pm, David Mark <dmark.cins...(a)gmail.com> wrote:
> LOL.  You really think this "jr" guy is using XML parse mode?
This jr guy is a girl. Janis or Jane Rough.

She has been trying to program for 10 years and still can't master the
basics.

Check out her posting profile in Google groups and you'll see what I
mean.