[Javascript] Sorting Problem in Javascript

Hassan Schroeder hassan at webtuitive.com
Thu Feb 5 01:04:41 CST 2004


Rajkumar M wrote:

> Actually I want to sort the list of rows displayed using XML. Its working
> fine in our internal server but not in external server. The only difference
> is we are having SSL for the external server.
> Here is the sample of code:
> The script gives an exception  (  'list.item(...)' is null or not an
> bject  )  while executing the last line
> 
>                 xslob = new ActiveXObject("Microsoft.XMLDOM");
>                 xslob.async = "false";
>                 xslob.load ("../sort.xsl");
>                 list = xslob.getElementsByTagName("xsl:apply-templates");
> 
>         list.item(2).setAttribute("order-by",sortorder+sortcol); //Here the
> problem comes
> 
> I think the list has no value that's why it is giving this exception. 

According to MSDN, load() returns true or false for success or
failure -- you could check that result.

(It also shows the argument to .async as false (boolean) rather than
"false" (as a string), but I don't know if that's significant.)

 > Why the list has not loaded?

If it's not loading, it may be that it's trying port 80 instead of
sending the request to port 443; have you used Ethereal or some other
sniffer-type software to watch the load attempt?

Anything in the server error and access logs?

FWIW!
-- 
Hassan Schroeder ----------------------------- hassan at webtuitive.com
Webtuitive Design ===  (+1) 408-938-0567   === http://webtuitive.com

                           dream.  code.






More information about the Javascript mailing list