NetTalk Central

Author Topic: JQuery Buttons and Chrome  (Read 6064 times)

johncorry

  • Newbie
  • *
  • Posts: 27
    • View Profile
    • Email
JQuery Buttons and Chrome
« on: February 09, 2013, 12:28:28 PM »
I am using JQuery buttons on a radio selection to create a nice tagged box scale. It works well with Firefox and IE but not with Chrome where the JQuery buttons request is ignored. I am assuming I am missing out on a style sheet but including chrome in the gzip doesnt help

type web\styles\chromemenu.css >> web\styles\all.css
type web\styles\chrome.css >> web\styles\all.css

What am I missing??
Thanks
John

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: JQuery Buttons and Chrome
« Reply #1 on: February 10, 2013, 09:46:07 PM »
Hi John,

perhaps try clearing the cache in both the FF and Chrome browsers and see if it makes a difference.
It sounds to me like you've got a file tied up in the cache somewhere.

ps - chromemenu isn't related to the chrome browser. That's the old, now deprecated horizontal menu.

cheers
Bruce

johncorry

  • Newbie
  • *
  • Posts: 27
    • View Profile
    • Email
Re: JQuery Buttons and Chrome
« Reply #2 on: February 10, 2013, 11:28:05 PM »
Gday Bruce
Cleaning out the cache in Chrome and FF has made no difference unfortunately. It is interesting in that I am using the radio on a form as a popup from multiple selections of body location held  on a button grid as I talked of a few weeks back. It is working nicely on FF and IE.
But not only does chrome not present the radio with the jQuery buttons, if you make a second call to the popup it messes it and hangs. I will keep playing.
I put chromemenu in just to be sure. I will remove it.

On further testing the JQuery Buttons for radio is  working with Chrome on another form but not with the form called as a popup?? Does this help understand?
 
John
« Last Edit: February 11, 2013, 02:07:44 AM by johncorry »

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: JQuery Buttons and Chrome
« Reply #3 on: February 11, 2013, 06:53:04 AM »
sounds like there is a javascript error on the page. Open Firebug and see if anything is reported on the console. If not then open the Chrome developer tools window and check the console there as well.

cheers
Bruce

johncorry

  • Newbie
  • *
  • Posts: 27
    • View Profile
    • Email
Re: JQuery Buttons and Chrome
« Reply #4 on: February 12, 2013, 04:31:13 AM »
Gday Bruce
Well I am certainly swimming upstream now. I had hoped to leave all the js stuff to you!! But never too old to learn maybe!!
With Firefox I got this error related to all.js
sv('','paindescription_loc_bodyside__value',257,)  . I opened all.js but couldn't find this anywhere

With Chrome there was a lot more which I don't understand. I tried swapping the js files with those that came with the forum app but no different. I am not sure how to correct this one.

...
Port error: Could not establish connection. Receiving end does not exist. miscellaneous_bindings:236
chromeHidden.Port.dispatchOnDisconnect miscellaneous_bindings:236
Uncaught ReferenceError: jQuery is not defined jquery-ui.min.js:9
Uncaught ReferenceError: $ is not defined script.js:1
Resource interpreted as Script but transferred with MIME type text/html: "http://www.superfish.com/ws/sf_main.jsp?dlsource=axrrkwbo&userId=41460-2937-1353310195222-716016&CTID=41460_2937".
Resource interpreted as Script but transferred with MIME type text/plain: "http://chrome.dealply.com/version_content.js?partner=wddt&channel=wddt41460&appTitle=".
Resource interpreted as Script but transferred with MIME type text/plain: "http://chrome.dealply.com/chrome_1357228151746/chrome_content.js?sg=&partner=dealplydef&channel=dealplydef".
Resource interpreted as Script but transferred with MIME type text/html: "https://in.admedia.com/?id=ODkoPiM&inline_highlight=false&subid=41460_2937".
GET http://api.ciuvo.com/api/analyze?uuid=79CC5398-B792-4D38-A499-659079FB8198&tag=pricesparrow&version=1.4.9&campaign=&url=http%3A%2F%2F127.0.0.1%3A88%2F 400 (Bad Request) iframe-1.4.min.html:39
Uncaught SyntaxError: Unexpected end of input iframe-1.4.min.html:44
Uncaught Not a valid URL: http://127.0.0.1:88/index.htm in.admedia.com:105
Uncaught SyntaxError: Unexpected token )

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: JQuery Buttons and Chrome
« Reply #5 on: February 12, 2013, 09:49:29 PM »
Hi John,

thanks for the detailed report.

>> sv('','paindescription_loc_bodyside__value',257,)  . I opened all.js but couldn't find this anywhere

it's not in all.js, it's in your (generated) html page.
As you've noted this is JavaScript, and the key is the trailing comma. JavaScript allows parameters (at the end of the parameter list) to be excluded - but it doesn't allow "blank" parameters - ie there must always be something after a comma.

In JavaScript as soon as it hits an error, it stops. So you see it as a button not being marked up properly, or something doesn't work when you click on it, and so on.

Fortunately the line of code gives us some clues as to the mistake.
PainDescription is the procedure name, loc_bodyside is the field value.
257 is "event selected".

Looking at the template code I see that "event selected" will work for DISPLAY fields, but will cause this error for other fields. I've fixed that in the template for 7.06.

I suppose the question this leads us to though is why you're turning on the code for Event Selected in the first place? This is a fairly uncommon operation for non-display fields (clearly). So this might be something for you to consider, or feedback on.

cheers
Bruce

johncorry

  • Newbie
  • *
  • Posts: 27
    • View Profile
    • Email
Re: JQuery Buttons and Chrome
« Reply #6 on: February 13, 2013, 06:22:32 PM »
Thanks Bruce
Body side is a radio selection and on its client side tab I have added some server code and  reset of other dependent variables. For no good reason I also ticked the refresh -  prompt, value ,comment for the bodyside variable. I was just trying to be thorough!!  Unchecking these seems to have resolved the problem and the appearance in chrome is as expected and the error in FF has gone.
With chrome everything now seems to work as desired but I am still getting some funny messages on the JS Console coming up before the call to the popup. Can I ignore them?

Port error: Could not establish connection. Receiving end does not exist. miscellaneous_bindings:236
Uncaught ReferenceError: jQuery is not defined jquery-ui.min.js:9
Uncaught ReferenceError: $ is not defined script.js:1
Failed to load resource: the server responded with a status of 400 (Bad Request) http://api.ciuvo.com/api/analyze?uuid=79CC5398-B792-4D38-A499-659079FB8198&tag=pricesparrow&version=1.4.9&campaign=&url=http%3A%2F%2F127.0.0.1%3A88%2F
Uncaught SyntaxError: Unexpected end of input iframe-1.4.min.html:1
Uncaught Not a valid URL: http://127.0.0.1:88/index.htm in.admedia.com:105

Thanks
John

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: JQuery Buttons and Chrome
« Reply #7 on: February 13, 2013, 10:49:57 PM »
Hi John,

be aware that errors from all your open tabs will appear in the console. So something like;

<< Failed to load resource: the server responded with a status of 400 (Bad Request) http://api.ciuvo.com/api/analyze?uuid=79CC5398-B792-4D38-A499-659079FB8198&tag=pricesparrow&version=1.4.9&campaign=&url=http%3A%2F%2F127.0.0.1%3A88%2F

is clearly from another site.

>> Port error: Could not establish connection. Receiving end does not exist. miscellaneous_bindings:236

I've never seen this (although I rarely use the Console in Chrome) but it doesn't look terrible.

>> Uncaught ReferenceError: jQuery is not defined jquery-ui.min.js:9
>> Uncaught ReferenceError: $ is not defined script.js:1

this would be bad. Usually this means some JavaScript error on the page.

>> Uncaught SyntaxError: Unexpected end of input iframe-1.4.min.html:1
>> Uncaught Not a valid URL: http://127.0.0.1:88/index.htm in.admedia.com:105

I guess these depend on the context. Not sure if they are from your site, or another site. Are you embedding adverts or analytics on your site?

cheers
Bruce