NetTalk Central

Author Topic: Using jquery with Nettalk or suppressing nettalks js for a page.  (Read 4533 times)

random69

  • Newbie
  • *
  • Posts: 24
    • View Profile
    • Email
I have a specifc page that needs jQuery and I'm having conflict issues.

First, has anyone gotten jQuery to work with NT? I've already used jQuery.noConflict().

Second, is there a way to tell nettalk NOT to include it's standard javascript and not use it? IOW, I can control what's being served?

TIA

Dave

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Using jquery with Nettalk or suppressing nettalks js for a page.
« Reply #1 on: March 07, 2008, 09:43:06 PM »
Hi Dave,

>> I have a specific page that needs jQuery and I'm having conflict issues.
>> First, has anyone gotten jQuery to work with NT? I've already used jQuery.noConflict().

I've not played with jQuery yet. What is the nature of your conflict?
It seems like the most likely conflict is with prototype, which we are using.

>> Second, is there a way to tell nettalk NOT to include it's standard javascript

yes. If for the whole site, then in the web server procedure, right click, choose Source, and search for
 ThisWebServer._SitesQueue.Defaults.HtmlCommonScripts
You'll see where it (and all the browser specific script properties) are set.
You can override them here if you like, and do a
Put(ThisWebServer._SitesQueue)

If you want to override just one page, then before the page header is sent (which depends on the procedure type being called) you can set the local version. ie
p_web.site.HtmlCommonScripts
etc.

>> and not use it?

um - well no. If, for example you're on browse, then the browse JavaScript is necessary. If on a Form then the Form JavaScript is necessary.

Cheers
Bruce


random69

  • Newbie
  • *
  • Posts: 24
    • View Profile
    • Email
Re: Using jquery with Nettalk or suppressing nettalks js for a page.
« Reply #2 on: March 08, 2008, 11:03:15 AM »
Hi Bruce...

It's hard to tell what's in conflict directly since all.js has the combined javascript. At first I thought it was prototype, and there's definitely work around for that (not to mention jQuery has it's own namespace). Basically I get two errors - one on a jQuery(window).bind and one on a jQuery(document).ready call. I do realize the browse needs the functionality, but these pages are simple (that's all I need jQuery for). It does work locally without the webserver.

I did gather it was the HtmlCommonScripts - I'll take a look at the .site local part to see how that goes.

BTW, I'm really impressed with NT - I have easily setup AJAX on one of may pages to respond with a JSON response. I don't have the need for XML for this - so I whipped up a GROUP to JSON converter. Very slick and fast (obviously no XML parsing) in preliminary testing. It handles the JSONP callback requests as well - so even robust enough to handle as a public web service. jQuery handles these ajax requests very nicely too (I would imagine prototype is equally the same). It was very easy to setup the response page procedure. Cool. I'm afraid to see what's next. :)

Dave



Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Using jquery with Nettalk or suppressing nettalks js for a page.
« Reply #3 on: March 09, 2008, 06:56:26 AM »
Hi Dave,
>>It's hard to tell what's in conflict directly since all.js has the combined javascript.

You can "uncombine it" by ticking off the option on the WebServer procedure, Advanced tab.

>> It does work locally without the webserver.

ok, so you should be ok just suppressing the scripts.

The JSON stuff sounds cool.

Cheers
Bruce