NetTalk Central

Author Topic: error in site javascript  (Read 4473 times)

ntnewbies

  • Full Member
  • ***
  • Posts: 184
    • View Profile
    • Email
error in site javascript
« on: December 25, 2017, 10:53:18 PM »
hi friends,
in my netbrowse embed coding - before heading i put the following:

packet.append('<script src="https://assets.fortumo.com/fmp/fortumopay.js" type="text/javascript"></script>')

and once i compile it, it says error in site javascript.

when i inspect it via chrome, it says
Uncaught TypeError: jQuery(...).corners is not a function
    at HTMLDocument.<anonymous> (all.js:407)
    at j (all.js:1)
    at Object.fireWith [as resolveWith] (all.js:1)
    at Function.ready (all.js:1)
    at HTMLDocument.K (all.js:1)

is there a script conflict??


Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: error in site javascript
« Reply #1 on: January 02, 2018, 07:44:26 AM »
Hi Jason,
>>in my netWebBrowse page, if i check Allow xhtml in heading
 
I suspect you don't need this switch on.
 
>> and put the following code in the xhtml (after heading)
<script src="https://assets.fortumo.com/fmp/fortumopay.js" type="text/javascript"></script>
>> when i inspect the browser, i get the following:-

I suspect the fortumopay.js file is doing it's own load of the jquery libraries. ie it includes links to load 
 https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js

This is likely a problem because loading javascript from multiple sources is often blocked by browser settings, or browser extensions and so on. (Typically by add-blockers etc.)  In this case it will likely lead to more problems as well because that version of jQuery is not necessarily the same as the one loaded by NetTalk and so various conflicts will occur.

Your best starting point would be to inspect the fortumopay js file, and remove calls to load other libraries. Rather move those libraries local (if they are not already local) and load them before the fortumopay js file in your page.
 
cheers
Bruce