Jump to content
Jeremiah

[Solved] Platform 5, Page editor won't load with added javascript.

Recommended Posts

Jeremiah

Error: editing.js?ver=930684:5 Uncaught TypeError: Cannot read property 'getData' of undefined

I have all of the plugins disabled and I still receive the error.

Page Editor will not load on page.

 

Share this post


Link to post
Share on other sites
Simon

You mentioned in the support ticket the following:

Quote

Pagelines page editor on the right is not functioning with a javascript I am using.

What javascript are you using?

Share this post


Link to post
Share on other sites
Simon

This topic has been marked as solved.

Share this post


Link to post
Share on other sites
Simon

This is a simple fix, here is the code that was supplied

<!-- Start LoanTek Widget Code -->
<div id="FORM_DIV"></div>
<div id="RESPONSE_DIV"></div>
<script type="text/javascript" src="https://clients.loantek.com/widgets/quotewidget-2.2.js"></script>
<script type="text/javascript">
window.onload = function () {
LoanTek.QuoteWidget({ PartnerID: xxx });
LoanTek.init();
}
</script>
<!-- End LoanTek Widget Code -->

Troble here is including remode scripts like this pasted from the internet tends to break all scripts that follow it.

Scripts HAVE to be in the header or footer.

Solution

  1. Put the script elements into the scripts area in the global settings area. Thats what its for.
  2. Add the HTML elements ( the two divs in your example ) into your page via a media section.

 


 

Share this post


Link to post
Share on other sites
Jeremiah

   I tried both ways in header and out of header I get the same error.

editing.js?ver=d12006:5 Uncaught TypeError: Cannot read property 'getData' of undefined

Share this post


Link to post
Share on other sites
Simon

Right send me a login.

Ive tested this with your code and it works perfectly fine.

Share this post


Link to post
Share on other sites
Jeremiah

Okay I emailed it.

Share this post


Link to post
Share on other sites
Simon

Right after closer examination, your widget code includes an old version of jQuery. You cant run 2 different versions of that library on a page without breakage.

So a workaround.

Ive added the snippet back into your page in a media section, to edit your page you will have to add &plsafemode to your url to stop that widget breaking the entire builder.

Thats the only thing I can suggest as we cant stop the widget loading its old jquery libs.

Also you will encounter breakage if you add any other section/plugins that rely on jQuery as there are conflicting versions being loaded.

Share this post


Link to post
Share on other sites
Jeremiah

Should I contact the author of the code and see if there will be an update to the jQuery?

Thank you for all your help.

Share this post


Link to post
Share on other sites
Simon

Probably not worth it, they will still load jquery on the page as they need it for their widget.

This is the problem with copy/paste solutions, they design it to work on any page for end users with zero coding experience, they will never update that code for one person.

 

Share this post


Link to post
Share on other sites
Jeremiah

&plsafemode is not working in the URL? 

Share this post


Link to post
Share on other sites
Simon

Yes it does as long as you are logged in, I used it on your site.

Share this post


Link to post
Share on other sites
Jeremiah

I must be doing something wrong. I get a 404 message. Please explain it.

Share this post


Link to post
Share on other sites
Simon
  1. login to your site and navigate to the page with the issue.
  2. Start the builder.
  3. In your browser url bar add &plsafemode to the end of the url and click enter.

Share this post


Link to post
Share on other sites
Jeremiah

Thank You I wasn't starting the builder first. I appreciate your patience.

Share this post


Link to post
Share on other sites
Simon
1 minute ago, Jeremiah said:

Thank You I wasn't starting the builder first. I appreciate your patience.

no problem :)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Similar Content

    • IDdigital
      By IDdigital+
      Hi,
      A site of ours irregularly does not finish loading. The page in question is https://rw360.org/grievance-process/
      In Safari, I'll occasionally get the following error:
      [Error] TypeError: undefined is not an object (evaluating 'a.plModel.init')
          (anonymous function) (site.js:5:91)
          i (jquery.js:2:27455)
          add (jquery.js:2:27750)
          ready (jquery.js:2:29819)
          (anonymous function) (site.js:5)
          Global Code (site.js:5:3421)
      This seems to be a bug in PageLines as far as I can tell. Any suggestions or a fix coming?
      Thanks,
    • micstepl
      By micstepl+
      suddenly, I have issues (had worked for years now), that, when I VIEW certan pages, the PL-editor (bar) does not appear.  basically the URL does not attach the  ".... ?pl_edit=on" when clicking view. somebody knowing what the source of the Problem is?
    • romanondrasek
      By romanondrasek+
      Hi, I just found that my site is not working - nothing to see what I have activated PL5 tap late (just white screen :-() , I can open just admin site . I tried to activate different template (tventy seventeen) and was working , but not with PL5. 
      could you pls let me know what is the problem ASAP 
       
      the site is : www.myfit.cz
      than you so much
       
    • jharri74
      By jharri74
      Hello, I want to create a form where a visitor can submit content/post from the front end. I did something very similar some years back using wp-types, CRED form with pagelines DMS. When i try to set this up in Platform 5, the CRED form generates but doesn't show. I get a blank page. In the browser's console window, i get the error: Uncaught Error: You cannot apply bindings multiple times to the same element.
      When i deactivate the PL plugin and change the theme, the form appears.
      I'm using Wordpress 4.8.2 and PL 5.1.7
      Thanks.
    • Bill Bernat
      By Bill Bernat+
      Hi, I'm using a series of Loops sections on our PL5 site (insights.adaptiva.com), and on one section, I'd ideally like the loops to link to external URLs that are defined in the post in WordPress. Is that possible?
×