Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Professional JavaScript for Web Developers 2nd edition ISBN: 9780470227800
This is the forum to discuss the Wrox book Professional JavaScript for Web Developers, 2nd Edition by Nicholas C Zakas; ISBN: 9780470227800
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional JavaScript for Web Developers 2nd edition ISBN: 9780470227800 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old September 15th, 2010, 02:51 PM
Authorized User
Join Date: Sep 2003
Location: , , .
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
Default Cross Browser XPath Issue

On page 536 this code exists (this is just the relevant snippet of that code):

if (namespaces instanceof Object){
nsresolver = function(prefix){
return namespaces[prefix];
var result = doc.evaluate(expression, context, nsresolver,

I don't understand where the function parameter 'prefix' is coming from, at no point is this parameter being filled with any data that the function can work with when it is being called.

  #2 (permalink)  
Old September 18th, 2010, 08:54 PM
nzakas's Avatar
Wrox Author
Join Date: Dec 2004
Location: Peabody, MA, USA.
Posts: 217
Thanks: 0
Thanked 5 Times in 5 Posts

Prefix is passed in as part of document.evaluate(). When this method encounters a namespace prefix, it runs the namespace resolver function and passes in the namespace prefix to be resolved.
Nicholas C. Zakas
Author, Professional JavaScript for Web Developers (ISBN 0764579088)

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Cross browser compatibility hussainm BOOK: Professional Ajax ISBN: 978-0-471-77778-6 3 December 4th, 2006 07:34 AM
Handle Sessin in browser cross button click ashish2001mca General .NET 1 February 9th, 2006 10:28 AM
make javascript cross-browser crmpicco Javascript 5 October 25th, 2005 10:03 AM
Designing for cross browser site joefawcett CSS Cascading Style Sheets 3 June 22nd, 2005 08:09 AM
Cross Browser DHTMLMenu flash2004 Javascript 0 March 30th, 2005 02:30 AM

All times are GMT -4. The time now is 09:36 AM.

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.