JavaScript - Add-this Like Share Script
Hi, I want to create a share script like that used in addthis.com. Can anyone refer me to a free source code so that I can study its framework and create one that suites my needs? Thanks in advance.
Similar TutorialsHello guys. I have a daily deal aggregator site and i can't get the Facebook share to work properly. There are lots of deals on each page and each one has it's own FB share so they can post it on their wall, friends walls etc. here is the site so you can try the sha http://bit.ly/xFGzj5 Here is the code Im using now: Code: <!-- Each Deal has this button that links to FB --> <a href="http://www.facebook.com/share.php?u=<?php echo urlencode($shareurl); ?>" onclick="return fbs_click('<?php echo urlencode($shareurl); ?>','<?php echo $title; ?>')" target="_blank"><img src="../../images/fb.png" border="0" alt="Share On Facebook" class="smicon" /></a> <!--And here is the JS function:--> <script> function fbs_click(u,t) { window.open('http://www.facebook.com/sharer.php?u='+encodeURIComponent(u)+'&t='+encodeURIComponent(t),'sharer','toolbar=0,status=0,width=626,height=436'); return false; } </script> With this method, right now the title is not working properly, and sometimes an image shows up, sometimes it doesn't. When an image does show there are about 200 thumbnails to choose from (depending on how many deals are on the page) so the user has to cycle through it until they find the right one. Ideally, I want the url/title working properly (obviously) and have the image go to that specific deal's image by default when they click the share button. Anyone have any ideas on how to make this work??? Thank you so much! apparently I am not going to get any help from sharethis.com - I have implemented hsare this button on all my pages (upper right corner) of countyfairgrounds.net - I do not javascrip - I only do html5 and css3 - which believe me is hard enough. Okay that being said can somehelp me first get the words share this in the button - cause blye me - they are not there and I do not know why. NOR does this thingy validate in the validator.
Hi all I'm messing around with this video theme over at Hive45 ... the episodes change dynamically, but as you can see the social icons don't pickup the URL change. I found a guy who had a fix, but it was using the sexybookmarks wordpress plugin and I couldn't workout how to change the icons and control the display (my icons are manually coded). E.g... Code: <a rel="nofollow" id="linker" target="_blank" href="http://reddit.com/submit?url=http://hive45.com/shows/episode-2/&title=Episode 1" title="Reddit"><img src="http://hive45.com/wp-content/themes/hive45/images/reddit_32.png" title="Reddit" alt="Reddit" class="social"></a> Here's the fix: The main bit of work for the bookmarks was in the java.js and episode.php file. Firstly episode.php I added, after line 17: Code: // <---------- MS Starts Here ---------> if ( function_exists('get_sexy') ) $sexy_str = get_sexy(); endwhile; endif; echo 'sexy:' . $sexy_str ; // <---------- MS End Here ---------> Then in java.js in the ScreenWrite function, after around document.getElementById('linker').setAttribute("href",plinker); line 114 I added: Code: // <---------- MS Start Here ---------> // Find the sexy: tag, grab the text until the end, update the sexy-marks span then drop the text from=strep.indexOf('sexy:'); sexy=strep.slice(from+5); strep=strep.slice(0,from); document.getElementById('sexy-marks').innerHTML = sexy ; // <---------- MS End Here ---------> Again in java.js in the selectEpisode function right at the beginning: Code: // <---------- MS Starts Here ---------> // Get a reference to the sexy bookmarks part sexyObj=document.getElementById('sexy-marks'); //sexyObj.innerHTML=""; delete sexyObj; // <---------- MS Ends Here ---------> Finally in the index.php where you want the SexyBookmarks to be: Code: <span id="sexy-marks"> <?php $temp = $wp_query; query_posts("p=".$theid); if(function_exists('selfserv_sexy')) { selfserv_sexy(); } $wp_query = $temp; ?> </span> I'm a complete noob with javascript sadly. Any idea how to change the above code to work with manually coded bookmarks? cheers Hi All, I have two scripts which I want to try and integrate. I am using a nice gallery script to show thumbnails which are appended to a an image wrapper which on click of the thumbnail shows the larger image in the image wrapper, I am trying to implement cloud zoom which is a plugin which uses image srcs to then point to an anchor href to show another larger zoom image either in the same place.. which is what I am trying to do or in another div beside. I have had to set me img srcs up in a certain way to easily enter some product details. and I need to try an manipulate the code to make it work to suit my file layout. I am using a var= images [ with a series of file locations and info such as below { src: 'romanticabride/thumbs/tn_Shauna.jpg', srcBig: 'romanticabride/images/Shauna.jpg', title: 'Shauna', longDescription: '<b><H1>Shauna</H1></b><br><b>Romantica Of Devon <br><br><h2>Sizes Available:</h2><br> 6 - 32.<b><br><b><br><b><b><b><H2>Colours Available:</h2><b><br>Various<br>Please Enquire Below<br><br><br><br><a href="mailto:tracy@cherishbridal.co.uk?subject=Web Enquiry Regarding Romantica Shauna Bridal Gown"class="enquiry rose glow" >Click To Enquire About This Item </a>' }, what I need is for cloud zoom to work when the main image wrapper is hovered over which means it will need to add a class or when the whichever srcBig: is hovered over it gets wrapped by href to make the script work . one of my pages is http://www.cherishbridal.co.uk/romaticabride.html the cloud zoom script is at http://www.professorcloud.com/mainsite/cloud-zoom.htm.. I am happy to share a jsfiddle with someone or explain further or post some code. Thank you in advance I have a script that works in seamonkey(my html editor) but when I use it in IE8 it says errors happen. Here's the code (the first line is on line 7 of the html file): Code: <script type="text/javascript"> function enlarge(imageNum) { var numToString = ""; if(parseInt(imageNum) < 10){ numToString = "0" + imageNum; } else { numToString = imageNum + ""; } window.open("images/LgScreenshot"+numToString+".jpg","Screenshot "+imageNum,"status=0,height=675,width=900,resizable=0"); } </script> And the errors: Webpage error details User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; GTB0.0; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR 3.5.30729; InfoPath.3; .NET CLR 3.0.30729) Timestamp: Wed, 10 Feb 2010 14:58:16 UTC Message: Object expected Line: 150 Char: 1 Code: 0 URI: http://samssc2site.co.cc/Features.html Message: Invalid argument. Line: 18 Char: 1 Code: 0 URI: http://samssc2site.co.cc/Features.html does any expert know how to pass parameters in the <script ..> tag? for instance; Code: <script type="text/javascript" src="script.js ?param1=val1¶m2=val2&etc "> in the javascript script.js, how would we read the params after the question mark? for example, google this; google shopping cart /v2_2/cart.js I need to assign a key in the javascript to actually make the javascript work,. I have a bookmark in chrome , a javascript , which actually works when clicked on it .,. but how can i edit it so that i can actually make it work on click a key or combination of keys. i want to declare the key or keycombo in the script itself .,. the script is for catching the selected text on the webpage and opening a new tab(or window) and doing an exact search search of the selected text using google.com .,., So I want it to work it this way ., select the text press a key and it opens a new tab (or window) with an xact search .,. i want to declare the key or keycombo in the script itself .,. the script is for catching the selected text on the webpage and opening a new tab(or window) and doing an exact search search of the selected text using google.com .,., So I want it to work it this way ., select the text press a key and it opens a new tab (or window) with an xact search .,. Thanks in advance ., Nani On this website: http://evancoleman.net/index.php I really like on the top how the menu has like 5 or 6 icons, and when you hover over them it shows a bubble with the name in them. Does anybody know where I can find this script? Thanks. Hello again . If these questions concerning Regular Expressions are inappropriate in this forum please let me know . Thank You. This expression <script[^>]*>.*?</script> matches ... Code: <script type="text/javascript">var cnnIsHomePage = true;</script> but not ... Code: <script type="text/javascript"> var cnnIsHomePage = true; </script> Please , how can i match the latter ? Quote: function hTools() { var hTools = new Array(6); hTools[0] = "hand tools"; hTools[1] = "saw"; hTools[2] = "hammer"; hTools[3] = "screwdriver"; hTools[4] = "wrench"; hTools[5] = "pliers"; } if(hTools[0] == true) { document.forms[0].item_one.value ="0"; } else if(hTools[1] == true) { document.forms[0].item_one.value ="$20.00" } then I call it fro an onchage selection list Quote: <p><select name ="hTool" onchange ="return hTools();"> <option value ="hTool0">Hand Tool</option> Quote: Item 1: <input type ="text" name ="item_one" My script or my call or both is not working could you please look at it and tell me what I am doing wrong Hey, I have a forum, and the forum has an rss feed. I want to take the most 10 recent posts from the feed and insert it into my Home page. I have no clue how to do this. At the moment I have been manually entering the posts as you can see here. All the recent posts on the right side of the page are manually entered by me from my forum. Just wondering if anyone could guide me in a direction to do this programmatically. I'm using this javascript on my site, it works perfect. The script changes the background image on the site, just need some mods and I'm no expert. <script language="JavaScript"> <!-- // Copyright 2001 by www.CodeBelly.com // Please do *not* remove this notice. var backImage = new Array(); // don't change this // Enter the image filenames you wish to use. // Follow the pattern to use more images. The // number in the brackets [] is the number you // will use in the function call to pick each // image. // Note how backImage[3] = "" -- which would // set the page to *no* background image. backImage[1] = "/images/bg1.jpg"; backImage[2] = "/images/bg2.jpg" backImage[3] = "/images/bg3.jpg" backImage[4] = "/images/bg4.jpg" backImage[5] = "/images/bg5.jpg" // backImage[4] = ""; this will set to no image // Do not edit below this line. //----------------------------- function changeBGImage(whichImage){ if (document.body){ document.body.background = backImage[whichImage]; } } //--> </script> How Can I set the parameters for the images with the following background-attachment: fixed; background-repeat: no-repeat; background-position: top and make the first image the default background when the site comes up -thanks Eddie i have this Code: VERSION BUILD=6650406 RECORDER=FX TAB T=1 URL GOTO=something.com TAG POS=2 TYPE=INPUT:TEXT FORM=NAME:NoFormName ATTR=NAME:id CONTENT=something1 SET !ENCRYPTION NO TAG POS=2 TYPE=INPUT:PASSWORD FORM=NAME:NoFormName ATTR=NAME:pw CONTENT=something1 SET !ENCRYPTION NO TAG POS=1 TYPE=INPUT:PASSWORD FORM=NAME:NoFormName ATTR=NAME:pw2 CONTENT=something1 TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:NoFormName ATTR=NAME:email CONTENT=something@so.com.com TAG POS=1 TYPE=SELECT FORM=NAME:NoFormName ATTR=NAME:year CONTENT=%1964 TAG POS=1 TYPE=INPUT:SUBMIT FORM=NAME:NoFormName ATTR=VALUE:Register! now what i need is to change the code so the "something" in all CONTENT will change everytime. the math formula would be [x]+1 where x = something so it would end up as something1 ->something2->something3 and so on and on and on any ideas how can i change it? sorry - total javascript newbie over this side of screen Hi everyone: I need help taking this pop under script: <script language="JavaScript"> var popunder="URL GOES HERE" function loadpopunder(){ win2=window.open(popunder) win2.blur() window.focus() } loadpopunder() </script> and making it so that I can set it so it only pops up one time and then will not pop up again until after a certain time period. Also, is there a way to make it so it can avoid pop up blockers? Thank you! I'm looking for something that i can put into my HTML page that will display the following information about the users computer: OS version, browser version, quicktime + flash + adobe reader + java + windows media player + sliverlight versions of the users computer. Can anyone please help??? I don't know a lot about this so something i could copy and paste would be great! I need it to work across all the major browser types. Thanks!!!! Hi everyone, I just wrote a little noob script and JSL tester says no errors but I think there's some kind of problem.....can you help me fix the problem???? Code: function doattack(baseatk, wepatk, wepcritmax, oppdef, oppdeffactor, oppextradefmax, opphealth, oppname) { var OpponentHealth = opphealth; var OpponentName = oppname; var BaseATK = baseatk; var WeaponATK = wepatk; var WeaponCriticalMax = "100+Math.floor(Math.random()*wepcritmax+1)"; var ActualWeaponATK = "WeaponATK * WeaponCriticalMax / 100"; var OpponentDEF = oppdef; var DEFfactor = oppdeffactor; //defensefactor: used to multiply preoppdef to calculate actualoppdef so more in number the better rmbr that deffactor must be less than 1 var DEFCriticalMax = "100+Math.floor(Math.random()*oppextradefmax+1)"; var PreOpponentDEF = "OpponentDEF * DEFCriticalMax / 100"; var ActualOpponentDEF = "PreOpponentDEF * DEFfactor"; var DamageDone = "BaseATK + ActualWeaponATK"; var OVRDamageDone = "DamageDone * ActualOpponentDEF / 100"; document.write("You just inflicted " + OVRDamageDone + " damage to " + OpponentName + "!" + "<br>"); var NewOpponentHealth = "OpponentHealth - OVRDamageDone"; if (NewOpponentHealth < 0) { document.write(OpponentName + " is dead!" + "<br>"); break; } else { doattack(BaseATK, WeaponATK, WeaponCriticalMax, OpponentDEF, DEFfactor, DEFCriticalMax, NewOpponentHealth, OpponentName); } } doattack(5, 50, 25, 6, 0.22, 10, 200, RedBabyDragon); GREAT THANKS Hi there, I'm not too familiar with js, so I'm asking for help I have this script below which loads flash object after clicking fb like button. My question is how to do it after clicking the fb like button automatically to recognize youtube flash object or an object from another tube site? Is it possible? Thank you in advance! Code: <script type='text/javascript'> window.fbAsyncInit = function() { FB.init({appId: "0000000000000", status: true, cookie: true, xfbml: true}); }; (function() { var e = document.createElement("script"); e.async = true; e.src = document.location.protocol + "//connect.facebook.net/en_US/all.js"; document.getElementById("fb-root").appendChild(e); }()); FB.Event.subscribe('edge.create', function(href, widget) { setTimeout("playvideo1();", 0); }); function playvideo1() { document.getElementById('playvideo1').innerHTML = '<object ....... </object>'; } </script> hi, can any tell me that which script they are using?? and plz if u have share it Thanx http://www.nation4all.org/mf/ regards Fawad Hello Everyone, Im having trouble at work. They asked me to write a script that will take the 25 first words of a web page and store it to use it later on in the back office of a platform. My problem is i do not know how to get javascript to view 25 words from a site. I wouldnt be able to touch the HTML on the Site. Is this possible? please help HI - I'm creating a golf website and the clients asked to put a "Golf Tip" on the site that could be changed. A Google search led me to your script (copied below) for "Tip of the Day", which seems to be exactly -- almost -- what I need. Can you tell me how to change the font color (for the tips) from gray to White? Also, is it possible to alter the script to make the tips weekly rather than daily? Thanks much, Richard Code: <table border="0" width="100%" bgcolor="#E8E8E8" cellspacing="0" cellpadding="0"> <tr><td width="100%"> <script> <!-- /* Tip of the day script By JavaScript Kit (http://javascriptkit.com) Over 200+ free scripts here! */ var today_obj=new Date() var today_date=today_obj.getDate() var tips=new Array() //Configure the below variable to contain the "header" of the tip var tiptitle='<img src="../../tip.gif"> <b>JavaScript Tip of the day</b><br />' //Configure the below array to hold the 31 possible tips of the month tips[1]='Tip 1 goes here' tips[2]='Tip 2 goes here' tips[3]='Tip 3 goes here' tips[4]='Tip 4 goes here' tips[5]='Tip 5 goes here' tips[6]='Tip 6 goes here' tips[7]='Tip 7 goes here' tips[8]='Tip 8 goes here' tips[9]='Tip 9 goes here' tips[10]='Tip 10 goes here' tips[11]='Tip 11 goes here' tips[12]='Tip 12 goes here' tips[13]='Tip 13 goes here' tips[14]='Tip 14 goes here' tips[15]='Tip 15 goes here' tips[16]='Tip 16 goes here' tips[17]='Tip 17 goes here' tips[18]='Tip 18 goes here' tips[19]='Tip 19 goes here' tips[20]='Tip 20 goes here' tips[21]='Tip 21 goes here' tips[22]='Tip 22 goes here' tips[23]='Tip 23 goes here' tips[24]='Tip 24 goes here' tips[25]='Tip 25 goes here' tips[26]='Tip 26 goes here' tips[27]='Tip 27 goes here' tips[28]='Tip 28 goes here' tips[29]='Tip 29 goes here' tips[30]='Tip 30 goes here' tips[31]='Tip 31 goes here' document.write(tiptitle) document.write(tips[today_date]) //--> </script> </td></tr></table> <p align="center"><font face="arial" size="-2">This free script provided by</font><br> <font face="arial, helvetica" size="-2"><a href="http://javascriptkit.com">JavaScript Kit</a></font></p> |