Jump to content

Archived

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

rijans

HTML/JS not making output

Recommended Posts

rijans

HTML/Java script type code not working(not giving output) in either of Textbox or media box. They just stay blank!

In case u want, the code is,

<script>
  (function() {
    var cx = '010246379168072596147:zwu_remky9w';
    var gcse = document.createElement('script');
    gcse.type = 'text/javascript';
    gcse.async = true;
    gcse.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') +
        '//www.google.com/cse/cse.js?cx=' + cx;
    var s = document.getElementsByTagName('script')[0];
    s.parentNode.insertBefore(gcse, s);
  })();
</script>
<gcse:searchbox></gcse:searchbox>

Which is a Google CSE code. Any fix?

 

My site is TechGainer.com , and here's what I did >> https://drive.google.com/file/d/0B0vZboRb5S2OZS0yNmV5Q3hNZEE/edit?usp=sharing


.....Being a code noob, I want highest control as much as possible! What a mismatch! ......

.......Feeling Rockstar with DMS! .......

....I believe there's nothing like DMS....

Share this post


Link to post
Share on other sites
greenfly

the google drive link returns 

 

403. That’s an error.

Your client does not have permission to get URL/DqwDdniyoXVu50sUGM4VtYNxn1wx55BIqpy0dB1gjJR6xD6DoxvXXF6wWHr4pfRR87i9iVjbCZQsnNYfrom this server. (Client IP address: XXXXXXXXXX)

ACL Denied That’s all we know.


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
rijans

Martin Davies

 

Here's the image link http://postimg.org/image/k7rbqklqd/full/


.....Being a code noob, I want highest control as much as possible! What a mismatch! ......

.......Feeling Rockstar with DMS! .......

....I believe there's nothing like DMS....

Share this post


Link to post
Share on other sites
Danny

HI,

 

The TextBox section is supposed to house nothing more than text, the MediaBox is supposed to house text, html and other media via html. None of them can house JavaScript. If you wish to implement javascript, I recommend you use a hook. For more information on hooks see our documentation here - https://github.com/pagelines/Docs/blob/master/advanced/hooks.md


Please search our forums, before posting!

Share this post


Link to post
Share on other sites
rijans

HI,

 

The TextBox section is supposed to house nothing more than text, the MediaBox is supposed to house text, html and other media via html. None of them can house JavaScript. If you wish to implement javascript, I recommend you use a hook. For more information on hooks see our documentation here - https://github.com/pagelines/Docs/blob/master/advanced/hooks.md

 

Danny

Then take a look at http://docs.pagelines.com/tutorials/using-sections ... Checkout the TextBox info >>>......" Textboxes can usually accommodate HTML, PHP or shortcodes in addition to text".......<<<<
Then what's that?


.....Being a code noob, I want highest control as much as possible! What a mismatch! ......

.......Feeling Rockstar with DMS! .......

....I believe there's nothing like DMS....

Share this post


Link to post
Share on other sites
Simon

Javascript is not HTML.

Anyway I created a custom search to test this, I added a textbox and put this code in it:

 

<script>
(function() {
var cx = '002850982299749365326:eonehb8boro';
var gcse = document.createElement('script');
gcse.type = 'text/javascript';
gcse.async = true;
gcse.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') +
'//www.google.com/cse/cse.js?cx=' + cx;
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(gcse, s);
})();
</script>
<gcse:search></gcse:search>

 

And that works no problem. So either the code you are entering is wrong/broken or google is blocking your site.

Maybe you should ask them?

Add your code to a blank html file on your server and open that in a browser, see if that works, or try my code.

Share this post


Link to post
Share on other sites
Danny

I've also updated the documentation on that page, as that was incorrect.


Please search our forums, before posting!

Share this post


Link to post
Share on other sites
rijans

Javascript is not HTML.

Anyway I created a custom search to test this, I added a textbox and put this code in it:

 

<script>
(function() {
var cx = '002850982299749365326:eonehb8boro';
var gcse = document.createElement('script');
gcse.type = 'text/javascript';
gcse.async = true;
gcse.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') +
'//www.google.com/cse/cse.js?cx=' + cx;
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(gcse, s);
})();
</script>
<gcse:search></gcse:search>

 

And that works no problem. So either the code you are entering is wrong/broken or google is blocking your site.

Maybe you should ask them?

Add your code to a blank html file on your server and open that in a browser, see if that works, or try my code.

 

Interestingly this code is working on my site in text box!!!! but none of mine!!!!!!


.....Being a code noob, I want highest control as much as possible! What a mismatch! ......

.......Feeling Rockstar with DMS! .......

....I believe there's nothing like DMS....

Share this post


Link to post
Share on other sites
galeksic
Hi, everybody! And sorry if I'm interrupting your discusssion : )
 
@rijans - That code works because it is "stand-alone" CSE <gcse:search> component.
 
You are using <gcse:searchbox> and you need <gcse:searchresults> in order CSE to work:
 
If any of you would have similar problem, you can see complete answer (to this question) on CSE Google product forum:
 
Cheers!

Share this post


Link to post
Share on other sites
rijans

@galeksic 

It's great to see you here! 

Thanks for your assistance and time!


.....Being a code noob, I want highest control as much as possible! What a mismatch! ......

.......Feeling Rockstar with DMS! .......

....I believe there's nothing like DMS....

Share this post


Link to post
Share on other sites

  • Similar Content

    • Michael Kummer
      By Michael Kummer+
      Hi guys!
      I am using a plugin called Speed Booster Pack to speed up the load time of michaelkummer.com. One of the plugin settings, Minimize HTML and JavaScript causes an error that I only get with Pagelines. With other themes, such as WordPress' Twenty Seventeen, I do not get that error.
      I have reproduced the problem on my staging site and if you look at the JavaScript console, you will see the following error:
      SyntaxError: Unexpected end of script
      Any clue what PageLines may be doing differently to be contributing to this issue? I contacted the plugin developer and they, of course, pointed me to the theme developer
      Thanks
      Michael
    • flourishdesignstudio
      By flourishdesignstudio+
      Hello,
      We are working on a site and the customers are complaining that the site loads too slowly. They contacted their host who mentioned that the Java Script is all loading at the beginning. Is it possible to delay the load of the less important Java Script until after the initial load to speed up the site? The goal is to load the page faster by minimizing the initial javascript calls.
      Are there any preferred plugins that you would recommend or does this end up causing excessive problems with plugins, etc.?
      Thanks for the help!
    • 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.
       
    • 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'' ] }); });
×