WordPress.org

Ready to get started?Download WordPress

Forums

Java script not working (12 posts)

  1. dexXx
    Member
    Posted 4 months ago #

    Hi. I want to implement java script on one of my sites pages. The script is tv guide and it is provided from another site specialized in tv guides.

    Instalation as they say should be just copy paste a code but that doesnt work for me. Could you please tell me how to implement the this code on site.

    <script type="text/javascript" src="http://mojtv.hr/tv-navigator/output2.ashx?kanal=1-2-3-4-185-186-&css=http://mojtv.hr/tv-navigator/css/24sata/style.css"></script><div class="mojtvprogram" style="text-align:right">mojtv.hr - kompletan <a href="http://mojtv.hr">tv program</a></div>

    Code is provided here
    LINK

    Thank you

  2. Tom Leger
    Member
    Posted 4 months ago #

    Can you provide a link to the page you are trying to include this code on? That will help troubleshoot why it isn't working for you.

  3. dexXx
    Member
    Posted 4 months ago #

    I have maintenance mod turned on because the site isnt opened yet is there any other way to provide you with more info or taking the maintenance is the only way

  4. Tom Leger
    Member
    Posted 4 months ago #

    I am able to place the script you provided into a post and it seems to work.

    Here is a screenshot of how it appears on my site, which is running a default twenty thirteen theme:

    http://imgur.com/q5WUPKp

    If you can't provide a link, could you try to use the script on another site to test it? It will be difficult for anyone to troubleshoot this without a live link, unfortunately.

  5. WPyogi
    Volunteer Moderator
    Posted 4 months ago #

  6. dexXx
    Member
    Posted 4 months ago #

    Thanks Tom. I guess the problem is then specific to my theme. I will try to thinker around it a little bit and if I don't make it I will get back.

    Wpyogi I will try that and report back the results.

  7. WPyogi
    Volunteer Moderator
    Posted 4 months ago #

    Have you read this?

    http://codex.wordpress.org/Using_Javascript

    JavaScript cannot be added to post content without a special WordPress Plugin that removes the filters that prevent unwanted code within the post content area for the protection of the user.

  8. dexXx
    Member
    Posted 4 months ago #

    Yeah I have. I dont know how but it worked. I deleted the page and re-created it and it works. But now there is a different CSS problem. If you know how to help please do, I want to place the blocks (HTV1,HTV2,RTL and others) in line and not one above other like on Tom's screenshot few posts above.

    here is the CSS of the script

    .mojtvprogram {font-family:tahoma, arial, helvetica; color:#d0d0d0; font-size:10px}
    .mojtvprogram a {color:#e0e0e0}
    .mojtvprogram h3 {display:none;text-indent:-9999px;margin:0px; font-size:11px; padding:5px 7px; color:#fff; background:#000}
    
    .mojtvprogram .tvopen {height:207px; overflow:hidden;}
    
    .mojtvprogram h4 {font-size:11px;background:#222; margin:0px; padding:0px; color:#a0a0a0; border-bottom:1px solid #000}
    .mojtvprogram h4 a {display:block; color:#fff; padding:5px 6px; border:1px solid #000; text-decoration:none}
    .mojtvprogram h4 a:hover {background:#333; color:#b0b0b0}
    
    .mojtvprogram table {background:#333; border-collapse: collapse; border-spacing:0px;display:none; color:#333; margin:0 0 0 0px; padding:0px; width:100%; border-bottom:1px solid #000}
    .mojtvprogram table.tvopen {display:block}
    
    .mojtvprogram h4.tvopen  {height:auto !important; background-color:#666}
    
    .mojtvprogram td {margin:0px; padding:3px 5px; vertical-align:top; border-bottom:1px solid #000}
    .mojtvprogram td.mojtvtime {text-align:right;background:#292929; color:#d80d1f; font-weight:bold}
    
    .mojtvprogram td.mojtvtitle {width:100%; color:#d0d0d0}
    .mojtvprogram td.mojtvtitle em {color:#b0b0b0; font-size:10px; font-style:normal}
    
    .mojtvprogram td.mojtvtitle a {color:#fff; text-decoration:none; border-bottom:1px solid #a0a0a0}
    .mojtvprogram td.mojtvtitle a.film {color:#fff;border-bottom:1px solid #a0a0a0}
    
    .mojtvprogram .first {background:#D76800 }
    .mojtvprogram .first td {background:#D76800 }
    .mojtvprogram .first td.mojtvtime {color:#000 }
    .mojtvprogram .first td.mojtvtitle a {color:#000; border-bottom:1px solid #333 }

    I guess .mojtvprogram h4 are the blocks. I tried float left and block inline functions but neither worked.

    Again thanks for helping me on this problem I appreciate it very much. and by the way I am not a professional designer or anything and I try my best to get by with google and forums like this so if I ask a noobish question my bad :) .

  9. WPyogi
    Volunteer Moderator
    Posted 4 months ago #

    so if I ask a noobish question my bad :)

    That's not bad at all - that's why we're here. And good for you for figuring things out :)!

    You actually need to get rid of "float" - that makes things go side by side. What you want is "clear" - so try adding that clear: both; to this CSS:

    .mojtvprogram h4 {
        background: none repeat scroll 0 0 #222222;
        border-bottom: 1px solid #000000;
        clear: both;
        color: #A0A0A0;
        font-size: 11px;
        margin: 0;
        padding: 0;
    }
  10. dexXx
    Member
    Posted 4 months ago #

    Tried it on every class but without luck. Still one above other.

  11. WPyogi
    Volunteer Moderator
    Posted 4 months ago #

    Oh rats, that's inline CSS - so it's harder to get rid of it - try adding the float: none !important; to the above -

    .mojtvprogram h4 {
        background: none repeat scroll 0 0 #222222;
        border-bottom: 1px solid #000000;
        color: #A0A0A0;
        float: none !important;
        font-size: 11px;
        margin: 0;
        padding: 0;
    }
  12. dexXx
    Member
    Posted 4 months ago #

    Still nothing. Is it possible that it is again some kind theme problem at my side?

Reply

You must log in to post.

About this Topic

Tags

No tags yet.