YOUAREtehSCENE Posted July 25, 2011 Share Posted July 25, 2011 I have a javascript code so that people need to say well click on "THANKS" before they view a link! I'm curious as to how I would implement the code into my wordpress site, can I put it into one of the theme files? or do I need to create a .php file, or something. please help Please see theses images. Before users say thanks. http://i51.tinypic.com/2w7hjds.jpg After users click on thanks http://i52.tinypic.com/2yjv4t2.jpg Before = image 1 after = image 2 function SayThanks() { $('div#DownloadLink').html("<img src=\"ajax-loading.gif\">"); $('div#DownloadLink').load("saythanks.php?id=61634"); } function AddMirror() { $('div#AddMirror').html("<form name=\"form1\"><input name=\"AddMirrorField\" type=\"text\" value=\"http://www.\" size=\"20\"><input type=\"Button\" value=\"Add New Mirror\" onclick=\"javascript:AddMirrorSubmit()\"></form>"); } function AddMirrorSubmit() { var mirror = document.form1.AddMirrorField.value; $('div#AddMirror').html("<img src=\"ajax-loading.gif\">"); $('div#AddMirror').load("addmirror.php?id=61634&mirror=" + mirror); } function ViewThanksList() { $("div#DivThanksList").slideToggle("slow"); } function Approve(id) { var id; var tweet = confirm("Do you want to post the release on twitter?\n\nNote:\nClick cancel when people decide to submit 20 horrible death metal albums in an hour"); if (tweet == true) { $('div#DivApprove').html("<img src=\"ajax-loading.gif\">"); $('div#DivApprove').load("dynamic/approve.php?tweet=1&id=" + id); } else { $('div#DivApprove').html("<img src=\"ajax-loading.gif\">"); $('div#DivApprove').load("dynamic/approve.php?tweet=0&id=" + id); } } function ShowDelete() { $('div#DivDelete').slideToggle("fast"); } function ShowUndelete(id) { var id; $('div#DivDelete').html("<img src=\"ajax-loading.gif\">"); $('div#DivDelete').load("dynamic/undelete.php?id=" + id); } function ShowReport() { $('div#DivReport').slideToggle("fast"); } function ShowUnreport(id) { var id; $('div#DivReport').html("<img src=\"ajax-loading.gif\">"); $('div#DivReport').load("dynamic/unreport.php?id=" + id); } function ShowComments() { $('div#DivComments').slideToggle("fast"); } function NewComment() { $('div#DivNewComment').slideToggle("fast"); } function ShowNfo() { $('div#divNfo').slideToggle("fast"); } function DeleteMirror(id, postid) { $("div#DivDeleteMirror" + id).html('<img src="../themes/girly/ajax-loading1.gif">'); $("div#DivDeleteMirror" + id).load('dynamic/deletemirror.php?mirrorid=' + id + '&postid=' + postid); } [attachment deleted by admin] Quote Link to comment https://forums.phpfreaks.com/topic/242791-need-a-javascript-coder-helper-for-a-clickable-link-to-users-who-say-thanks/ Share on other sites More sharing options...
ZulfadlyAshBurn Posted July 26, 2011 Share Posted July 26, 2011 you would like to change the image or text field? you can use ajax to do this. Quote Link to comment https://forums.phpfreaks.com/topic/242791-need-a-javascript-coder-helper-for-a-clickable-link-to-users-who-say-thanks/#findComment-1247161 Share on other sites More sharing options...
YOUAREtehSCENE Posted August 7, 2011 Author Share Posted August 7, 2011 you would like to change the image or text field? you can use ajax to do this. I would like to change the text field, as you can see in the first image i posted where it reads Download links: Click here to say thanks and view the download link I want "Click here to say thanks and view the download link" to change to the download link when someone clicks on that text Quote Link to comment https://forums.phpfreaks.com/topic/242791-need-a-javascript-coder-helper-for-a-clickable-link-to-users-who-say-thanks/#findComment-1253760 Share on other sites More sharing options...
ZulfadlyAshBurn Posted August 7, 2011 Share Posted August 7, 2011 <script> function link(link) { document.getElementById('lol').innerHTML = link; } </script> <p id="lol" onclick="link('http://google.com');">Click here to download</p>> sorry this is the working one. Quote Link to comment https://forums.phpfreaks.com/topic/242791-need-a-javascript-coder-helper-for-a-clickable-link-to-users-who-say-thanks/#findComment-1253765 Share on other sites More sharing options...
YOUAREtehSCENE Posted August 8, 2011 Author Share Posted August 8, 2011 So, your telling me i don't need all that other lines of code? if so okay? Now where do I put this, in my wordpress site? Quote Link to comment https://forums.phpfreaks.com/topic/242791-need-a-javascript-coder-helper-for-a-clickable-link-to-users-who-say-thanks/#findComment-1254556 Share on other sites More sharing options...
ZulfadlyAshBurn Posted August 11, 2011 Share Posted August 11, 2011 the script tag, place it before the end of the head tag. then just name your <p> or <div> or etc. Quote Link to comment https://forums.phpfreaks.com/topic/242791-need-a-javascript-coder-helper-for-a-clickable-link-to-users-who-say-thanks/#findComment-1255696 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.