Jump to content

Archived

This topic is now archived and is closed to further replies.

outtareach

Javascript got page not loading

Recommended Posts

outtareach    3
outtareach

I put some java snippet in a text box and now the page isnt loading but I cannot get in to remove the code.  Any suggestions here?

Share this post


Link to post
Share on other sites
outtareach    3
outtareach

I need to remove a textbox but cannot load the editor to remove it, is there any other option otherwise I cannot work on the site.

Share this post


Link to post
Share on other sites
greenfly    230
greenfly

What is the code you have added to the site? What does the code do? 


The answer to many issues can be found by searching in the forum before posting as someone else  may very well have had the same problem before you have.  Also, reading the documentation can help you gain a good understanding of how everything works. 

 

Please do not send me private messages. Occam's razor - The principle states "Keep things simple!"

Share this post


Link to post
Share on other sites
outtareach    3
outtareach

a stock ticker now the page just loads and I cant get to editor to change the code or remove it,  I need to manually somehow take it out to get the page loading or else I guess I have to stat over

Share this post


Link to post
Share on other sites
outtareach    3
outtareach

for some reason I put this code in a text box and it went nuts on me.  should have put in a widget  but I just wasnt thinking

   <!-- START Worden Top Gainers and Losers Ticker Widget -->
<script src="http://widgets.freestockcharts.com/js/jquery-1.3.1.min.js" type="text/javascript"></script> <script src="http://widgets.freestockcharts.com/script/WBIHorizontalTicker2.js?ver=12334" type="text/javascript"></script> <link href="http://widgets.freestockcharts.com/WidgetServer/WBITickerblue.css" rel="stylesheet" type="text/css" />
<script>
    var gainerTicker = new WBIHorizontalTicker('gainers');
    var lossTicker = new WBIHorizontalTicker('losers');
    gainerTicker.animate = false;
    gainerTicker.animationHost = lossTicker;
    gainerTicker.start();
    lossTicker.alsoMove = gainerTicker;
    lossTicker.start();
</script> <!-- End Scrolling Ticker Widget -->

Share this post


Link to post
Share on other sites
outtareach    3
outtareach

can you just tell me where the live code lives so I can manually remove the textbox from the page somehow?

Share this post


Link to post
Share on other sites
James B    436
James B

Hi there, I spoke to the Dev team on this and Simon wrote a hook to make DMS ignore the textbox code so you can get back in and delete it.

 

Paste the following code into your functions.php of the base theme or customise plugin - http://paste.pagelines.com/kPSUU9ih

 

Make sure you replace the page id and the clone id with the info you're targeting. Save, then refresh a couple of times to get it to take affect. 

 

Then you'll be able to go back into the editor, remove the script and save, then go back into the functions.php and remove the hook.


Kindly search the forum and read the documentation before posting. It will help you resolve many issues.

For CSS help be sure to check out W3Schools first and be sure to download FireBug for FireFox for troubleshooting.

James B

Share this post


Link to post
Share on other sites
outtareach    3
outtareach

thanks a bunch but where would I find the clone Id?  so I put this code into the functions file and change the data to match mine?

Share this post


Link to post
Share on other sites
James B    436
James B

Yeah, paste that code in to match the clone id and page id on your site. You can find these using the browser inspector tools, firebug or chrome dev tools etc. The page id will be near the top of the html inspector panel, the clone id will be within the section html.

 

http://screencast.com/t/OiJksGzift


Kindly search the forum and read the documentation before posting. It will help you resolve many issues.

For CSS help be sure to check out W3Schools first and be sure to download FireBug for FireFox for troubleshooting.

James B

Share this post


Link to post
Share on other sites
outtareach    3
outtareach

thanks James, I did what you said and put the below code in functions.php of my dms install and still not loading.

add_action( 'template_redirect', 'fix_mah_shit' );
function fix_mah_shit() {
	
	// these settings are CRUCIAL
	$postid = 476; // post/pageid
	$clone = 'u0bx1v'; // cloneid, use page inspector....
	$setting = 'textbox_content'; // what we nuking?
	//
	
	$data = get_post_meta( $postid );
	$data = maybe_unserialize( $data['pl-settings'][0] );
	$data['draft'][$clone][$setting] = '';	
	update_post_meta( 3859, 'pl-settings', $data );
}

Share this post


Link to post
Share on other sites
Simon    247
Simon

 

thanks James, I did what you said and put the below code in functions.php of my dms install and still not loading.

add_action( 'template_redirect', 'fix_mah_shit' );
function fix_mah_shit() {
	
	// these settings are CRUCIAL
	$postid = 476; // post/pageid
	$clone = 'u0bx1v'; // cloneid, use page inspector....
	$setting = 'textbox_content'; // what we nuking?
	//
	
	$data = get_post_meta( $postid );
	$data = maybe_unserialize( $data['pl-settings'][0] );
	$data['draft'][$clone][$setting] = '';	
	update_post_meta( 3859, 'pl-settings', $data );
}

You have to be logged in, and it ONLY updates the settings in the editor not the live site, and you have to refresh TWICE for it to work.

Share this post


Link to post
Share on other sites
outtareach    3
outtareach

I log in, go to functions php for dms and drop in the code.  refresh and try to go to the site and use editor and it still spins.  do I change    "update_post_meta( 3859, 'pl-settings', $data );" to match my page id also?  either way I still just get the loading page.

Share this post


Link to post
Share on other sites
Simon    247
Simon

oh, yea 

 

oversight by me.. unless your pageid is the same ;)

Share this post


Link to post
Share on other sites
outtareach    3
outtareach

thanks for the help but I changed and still it makes no difference with my editor.  I am putting this in functions.php

add_action( 'template_redirect', 'fix_mah_shit' );
function fix_mah_shit() {
	
	// these settings are CRUCIAL
	$postid = 476; // post/pageid
	$clone = 'u0bx1v'; // cloneid, use page inspector....
	$setting = 'textbox_content'; // what we nuking?
	//
	
	$data = get_post_meta( $postid );
	$data = maybe_unserialize( $data['pl-settings'][0] );
	$data['draft'][$clone][$setting] = '';	
	update_post_meta(476, 'pl-settings', $data );
}

Share this post


Link to post
Share on other sites
outtareach    3
outtareach

is there just a way to go into where it is generated and remove the text box code manually?

Share this post


Link to post
Share on other sites
Danny    1,327
Danny

Hi

 

Where abouts have you placed the code, in the DMS functions.php file ? If so, that is incorrect, all custom functions such as hooks need to be placed inside a child themes functions.php file.

Add the code to your child theme or customize plugins functions.php file and it then should work.


Please search our forums, before posting!

Share this post


Link to post
Share on other sites
outtareach    3
outtareach

I've tried both ways multiple times and nothing works.  I put the code in the pagelines customize plugin functions.php file and have reloaded my page 10 times and still just loading editor symbol. any other options would be appreciated.

Share this post


Link to post
Share on other sites
Simon    247
Simon

PM me an admin login

Share this post


Link to post
Share on other sites
Simon    247
Simon

Fixed. The code snippet is different as its a global scope setting.

 

https://gist.github.com/Pross/7436898

Share this post


Link to post
Share on other sites
outtareach    3
outtareach

appreciate it greatly, do I need to make any other changes to such as removing the custom code?

Share this post


Link to post
Share on other sites
Simon    247
Simon

I removed any code i added.

Share this post


Link to post
Share on other sites
outtareach    3
outtareach

thanks again but what way would you recommend implemented the javascript that gave me trouble? 

Share this post


Link to post
Share on other sites
Danny    1,327
Danny

I would recommend contacting the creating of the code, as the code itself is using an out of date jquery. Also, Wordpress already uses Jquery so there shouldn't be any need to include it in your script.


Please search our forums, before posting!

Share this post


Link to post
Share on other sites

  • Similar Content

    • chamois_blanc
      By chamois_blanc+
      I am trying to clone a container on a page. It throws the following javascript error:
      function l(b, c, e, f) { var g = m.a.f.get(b, p); if (!c) { if (g) throw Error("You cannot apply bindings multiple times to the same element."); m.a.f.set(b, p, !0) } I would appreciate guidance and a fix. Thank you
    • Jeremiah
      By 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.
       
    • DanatTLFN
      By DanatTLFN
      Site URL: thelocalfilmnetwork.com
      DMS Firmware: 2.2.1
      Wordpress: 4.5.1
      --------------------------------------
      Ticket Reference: 
       
      At the bottom of this post, there is a CSS only option that I have implemented into my site. It looks brilliant, and I am super grateful for that addition to the thread. The only issue I am having is that the code he provides does not include all of the styling options for the button itself.
      My question is, how might I go about editing the styling of the button i.e. shadows, every element of the coloring, and border colors?
      No big deal if it's not easy to fix. Happy to provide any further information if necessary.
      Kind regards,
      Dan
      P.S. I have opened up the button in Google Dev window with Inspect and start editing it there, but it looks like there are some areas of the code that are connected to an external source (most likely bootstrap) and therefore I can't seem to edit it as much as I would like.
    • oseehys
      By oseehys+
      Can someone give me a breakthrough out here?
      I have been on the media player for like 5 hours now yet it is still not displaying on my media box or the textbox,
      its a free media player on soundclound
      Great day ahead to the developers out here...
      am trying to install the Toneden media player https://www.toneden.io/player to display my songs on sound cloud, i followed everything on the doc, but obviuosly am missing something i did everything i can for 5 hours yet no breakthrough, am using the textbox as display.
      This is the html script i used, what am i missing here? see it below
        (function() { var script = document.createElement('script') script.type = 'text/javascript'; script.async = true; script.src = 'http://sd.toneden.io/production/toneden.loader.js' var entry = document.getElementsByTagName('script')[0]; entry.parentNode.insertBefore(script, entry); }()); ToneDenReady = window.ToneDenReady || []; ToneDenReady.push(function() { ToneDen.player.create({''enter code here'' dom: '#player', urls: [''https://soundcloud.com/reginaspektor'' ] }); });
    • wesleymusgrove
      By wesleymusgrove
      I'm trying to execute some simple JavaScript inline in the style.less file of my child theme.  But it causes some LESS compiler error and completely breaks the DMS editor so I can't edit anything or use the toolbar on the frontend.
      @all-background-colors: "#D09EC8,#F2DD8B,#84e0cd,#F3904E"; @background-color: color(~`@{all-background-colors}.split(',')[Math.floor(Math.random()*@{all-background-colors}.split(',').length)]`); body { background: @background-color; } On http://less2css.org/, this snippet works and randomly changes the body's background to 1 of the 4 colors in @all-background-colors.
      Even something as simple as this anonymous function breaks the compiler:
      @color: ~`(function(){ return "red"; })()`; body { background: @color; } The only way to fix the DMS editor is to remove the JS from my style.less file, and then edit and save the LESS fallback section in the dashboard.
      I tried setting PL_LESS_DEV in my wp-config.php according to http://www.pagelinestheme.com/dms-custom-less-tips/, but it doesn't clear the cache every page refresh like it's supposed to.
      define('PL_LESS_DEV',true); Is it possible to execute this kind of JavaScript in the style.less file of a DMS child theme?
×