Home > Forum

Support Forum

Not working with a .js

Discussions related to the HTML Javascript Adder WordPress plugin.

Not working with a .js

Postby oikeusel » Fri Jan 28, 2011 11:15 am

Hi Aakash!

Congratulations, the widget looks pretty nice. I am trying to put a counter in js as a widget. I do not know why it is not working. The counter is <script language=”JavaScript” src=”http://prolife.org.nz/count/women.js” type=”text/javascript”></script> and the page is http://oikeuselamaan.org

Thank you
oikeusel
 
Posts: 2
Joined: Fri Jan 28, 2011 11:10 am

Re: Not working with a .js

Postby oikeusel » Fri Jan 28, 2011 11:41 am

Hi, I tried writing directly the code:
<html>
<body>

<script type="text/javascript">
<!--
document.writeln('<style>div.wc { width:160px; height:290px; font-style:normal; text-align:center; } div.text { font-size:11px; font-family:arial; color:#000000; line-height:110%; } a, a:active, a:visited { text-decoration:none; }</style>');
document.writeln('<table width="100%"><tr><td align="center"><div class="wc" style="background-image:url(&#39;http://prolife.org.nz/count/women.jpg&#39;);">');
document.writeln('<form name="w" style="margin:0px;padding-top:90px;" title="Worldwide: aprox. 1 abortion / 0.72 sec"><input type="text" name="w2" size="5" style="background-color:transparent; font-family:Arial; font-size:25pt; text-align:center; color:#000000; padding:0; margin:0px; border:0;"></form>');
document.writeln('<div class="text" style="padding:5px 10px 0px 10px;" align="justify">aborttien määrä näillä sivuilla olosi aikana.</div><div class="text" style="padding:30px 3px 0px 5px;font-size:12px;" align="center"><b>Oletko raskaana?<br />Oletko tehnyt abortin?</b><br /><a href="http://oikeuselamaan.org" target="_blank"><font color="#ffffff">Voimme auttaa sinua!</font></a></div><div class="text" style="padding:35px 3px 2px 3px;" align="right"><a href="http://www.prolife.org.nz/count.htm" target="_blank"><font color="#000000">add to my blog</font></a></div>');
document.writeln('</div></td></tr></table>');
document.writeln('<script>');
document.writeln('' + '<' + '!' + '-' + '-' + '');
document.writeln('/*By George Chiang. (JK\'s ultimate JavaScript tutorial and free JavaScripts site!)');
document.writeln('http://www.javascriptkit.com');
document.writeln('Credit MUST stay intact for use*/');
document.writeln('var mil=0');
document.writeln('var sec=0');
document.writeln('document.w.w2.value=\'0\'');
document.writeln('function display1(){');
document.writeln('if (mil>=9){');
document.writeln('mil=0');
document.writeln('sec+=1');
document.writeln('}');
document.writeln('else');
document.writeln('mil+=1');
document.writeln('');
document.writeln('Number.prototype.insertComma1 = function(){');
document.writeln(' var w = this.toString();');
document.writeln(' var temp1 = \'\';');
document.writeln(' for (var j=w.length-1;j>=0;j-=3){');
document.writeln(' if ((j-3)>=0) temp1 = "," + w.substr(j-2, 3) + temp1;');
document.writeln(' else temp1 = w.substring(0, j+1) + temp1;');
document.writeln(' }');
document.writeln(' return temp1;');
document.writeln('}');
document.writeln('');
document.writeln('document.w.w2.value = sec.insertComma1()');
document.writeln('setTimeout("display1()",100/1.39)');
document.writeln('}');
document.writeln('display1()');
document.writeln('//' + '-' + '-' + '>' + '');
document.writeln(' </script>');
// -->
</script>

</body>
</html>

Now it works in the preview but not in the page, why????
oikeusel
 
Posts: 2
Joined: Fri Jan 28, 2011 11:10 am

Re: Not working with a .js

Postby vaakash » Sat Jan 29, 2011 1:53 pm

Theres a problem with your double quotes... use this script
Code: Select all
<script language="JavaScript" src="http://prolife.org.nz/count/women.js" type="text/javascript"></script>
User avatar
vaakash
Site Admin
 
Posts: 724
Joined: Sun Jan 17, 2010 11:15 am
Location: India


 


  • Related topics
    Replies
    Views
    Last post


Return to HTML Javascript Adder

cron


phpBB SEO