• 0

Javascript got page not loading


Question

Posted · Report post

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

22 answers to this question

  • 0

Posted · Report post

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
  • 0

Posted · Report post

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

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

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
  • 0

Posted · Report post

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
  • 0

Posted · Report post

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
  • 0

Posted · Report post

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.

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

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
  • 0

Posted · Report post

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

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

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
  • 0

Posted · Report post

 

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
  • 0

Posted · Report post

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
  • 0

Posted · Report post

oh, yea 

 

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

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

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
  • 0

Posted · Report post

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
  • 0

Posted · Report post

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.

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

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
  • 0

Posted · Report post

PM me an admin login

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

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
  • 0

Posted · Report post

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
  • 0

Posted · Report post

I removed any code i added.

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

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
  • 0

Posted · Report post

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.

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