BullGuard Antivirus Sale - 60% Off with openElement !
Forum Home Forum Home >

openElement

> Scripts for Your Website
  New Posts New Posts RSS Feed - Java script not responding [solved]
  FAQ FAQ  Forum Search   Register Register  Login Login

Java script not responding [solved]

 Post Reply Post Reply
Author
Message
Benvanj1 View Drop Down
Newbie
Newbie
Avatar

Joined: Nov 28 2016
Location: Cape Town
Status: Offline
Points: 7
Post Options Post Options   Thanks (0) Thanks(0)   Quote Benvanj1 Quote  Post ReplyReply Direct Link To This Post Topic: Java script not responding [solved]
    Posted: Dec 06 2016 at 11:42am
Hi guys, thanks again for your awesome programm... it is teaching me so much about coding...

I need some help please.... I'm busy with a simple site but i am trying to add into it a rating widget found at http://rating-widget.com, now the told me to put the main code before the </body> tag and then to put some smaller code on the page where I want to have the widget display.

I have figured out how to put the (display) code block visual in its place.... but when I add the source code: code block source... the preview doesn't want to open correctly...

I've even tried to go to the code page (where all the code is displayed) and adding it into there...
but it doesn't want to allow me to add it in just before </body> tag(as instructed by http://rating-widget.com).....

Please help...


Edited by Dmit OE - Dec 08 2016 at 3:17pm
Back to Top
Dmit OE View Drop Down
Admin Group
Admin Group


Joined: May 31 2012
Status: Offline
Points: 5283
Post Options Post Options   Thanks (0) Thanks(0)   Quote Dmit OE Quote  Post ReplyReply Direct Link To This Post Posted: Dec 06 2016 at 12:20pm
Hi,

To add a script at the end of the page body, use the Code Block (Source) type Javascript position EndBody.
Back to Top
Benvanj1 View Drop Down
Newbie
Newbie
Avatar

Joined: Nov 28 2016
Location: Cape Town
Status: Offline
Points: 7
Post Options Post Options   Thanks (0) Thanks(0)   Quote Benvanj1 Quote  Post ReplyReply Direct Link To This Post Posted: Dec 06 2016 at 12:49pm
hi Dmit OE

it is not working as well... but according to the site i mentioned it is supposed to be just before the beginning tag </body>...
Back to Top
Dmit OE View Drop Down
Admin Group
Admin Group


Joined: May 31 2012
Status: Offline
Points: 5283
Post Options Post Options   Thanks (0) Thanks(0)   Quote Dmit OE Quote  Post ReplyReply Direct Link To This Post Posted: Dec 06 2016 at 3:45pm
Please post here the exact integration code they provide. It is possible that, for example, the code is surrounded by <script> tags (to be removed, or the type of script is to be changed to HTML) and that it should be insterted into <head> and not before the "beginning" tag </body> (</body> is a closing of the body tag so it can't be "beginning").
Back to Top
Benvanj1 View Drop Down
Newbie
Newbie
Avatar

Joined: Nov 28 2016
Location: Cape Town
Status: Offline
Points: 7
Post Options Post Options   Thanks (0) Thanks(0)   Quote Benvanj1 Quote  Post ReplyReply Direct Link To This Post Posted: Dec 08 2016 at 11:22am
hi thanks for helping me!!!!!

the instructions as per the site: (this is all they say, copy and pasted)

Copy and paste the code below into your page immediately before the </body> tag.

the code:

<script type="text/javascript">(function(d, t, e, m){
    
    // Async Rating-Widget initialization.
    window.RW_Async_Init = function(){
                
        RW.init({
            huid: "297657",
            uid: "cdc228560ee110aa057e6873ede92da6",
            source: "website",
            options: {
                "advanced": {
                    "font": {
                        "bold": true
                    }
                },
                "size": "large",
                "style": "oxygen",
                "isDummy": false
            } 
        });
        RW.render();
    };
        // Append Rating-Widget JavaScript library.
    var rw, s = d.getElementsByTagName(e)[0], id = "rw-js",
        l = d.location, ck = "Y" + t.getFullYear() + 
        "M" + t.getMonth() + "D" + t.getDate(), p = l.protocol,
        f = ((l.search.indexOf("DBG=") > -1) ? "" : ".min"),
        a = ("https:" == p ? "secure." + m + "js/" : "js." + m);
    if (d.getElementById(id)) return;              
    rw = d.createElement(e);
    rw.id = id; rw.async = true; rw.type = "text/javascript";
    rw.src = p + "//" + a + "external" + f + ".js?ck=" + ck;
    s.parentNode.insertBefore(rw, s);
    }(document, new Date(), "script", "rating-widget.com/"));</script>

-------------------------------------------------------------------

then on the page where you want the rating to appear:

<div class="rw-ui-container" data-title="my awesome rating"></div>

if you want more that one rating you just change the data-title...

Thanks again for helping me...


Back to Top
Benvanj1 View Drop Down
Newbie
Newbie
Avatar

Joined: Nov 28 2016
Location: Cape Town
Status: Offline
Points: 7
Post Options Post Options   Thanks (0) Thanks(0)   Quote Benvanj1 Quote  Post ReplyReply Direct Link To This Post Posted: Dec 08 2016 at 11:34am
hey dude.... thank you... but I have sorted it out....

like i said before i am still a novice programmer: I tried to insert the code as Javascript code and not as html.... stupid... but that is how we learn


Thanks dude!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!1
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.047 seconds.