javascript - Why are my buttons not doing anything when clicked on? -
I am currently trying to create a site that has three buttons, one Facebook sharing one, one Twitter one and another Links for the second one video are classified as "Facebook", "Twitter" and "Play", however none of them goes to the link I wrote in my Javascript file. If this is anything wrong then this is my javascript file:
$ (function () {var click = 0; $ ('button'). ('Click', function () {Click ++; var percentage = Math.Move (Math area (click / 3 * 100), 100); $ ('percent)' width (percent + '%'); $ ('number.'). Percent + '%');}); $ ('. Facebook'). ('Click', function () {window.open ('http://www.facebook.com'); var w = 580 , H = 300, left = (screen.width / 2) - (w / 2), top = (screen.height / 2) - (h / 2), if ((screen.width> 480) || (Screen.height & lt; 480)) {window.open ('http://www.facebook.com/share.php?u=http://bit.ly/somawater', '', 'Toolbar = No No, not = location = no, directory = no, not position = no, menubar = no, scrollbar = no, resizable = no, copyhistory = no, width = '+ w +', height = '+ h +', top = '+ Top +', left = 'left');} and (window.open ('http://www.facebook.com/share.php?u=http://bit.ly/somawater', '' , 'Toolbars = no, location = no, directory = no, not position = no, menubar = no, scrollbars = no, resizable = no, copyhistory = no, width =' + w + ', height =' + + h + ' Up = '+ top +', left = '+ left); }}); $ ('Click', function () {var loc = encodeurIComponent ('http://bit.ly/somawater'), title = "Beautifully innovative natural water filter by Soma -". W = 580, h = 300, left = (screen.width / 2) - (w / 2), top = (screen.height / 2) - (h / 2); window.open ('http: // Twitter.com/share?text= '+ title +' and url = '+ loc,' 'height =' + h + ', width =' + w + ', up =' + up + ', left =' + Left + ', toolbar = 0, location = 0, menu bar = 0, directory = 0, scrollbar = 0');}); $ ('Play'). ('Click', function () {window.location.href = "http://kck.st/TH0NAN";}); });
In my HTML file, I call on this javascript file by saying
What is the name of the Share.js Javascript? Can anyone know what the problem might be? I can not understand it ...
Please check that the HTML element you are adding to events that On the page where the domain is ready when you have implemented the code for the domain. Maybe you can be HTML after the formation of HTML such as ezacks or some other source.
Try adding an event to the window load:
$ (window) .on ('load', function () {// Your code is to be placed here));
Comments
Post a Comment