javascript

how can I alter the URL on an addthis link after page load?

Is there a way to dynamically set the addthis:url attribute after page load? I am not having any success with this and am curiuos if anyone else has done it. Specifically, I have a page of images in a gallery that the user scrolls through and I'd like the addthis:url to point to whatever image is currently being viewed. My current (ugl...

How to change Facebook 'Like' button to 'Recommend' button

I have a snippet to create a 'Like' button for our news site: <iframe id="likeButton" src="http://www.facebook.com/widgets/like.php?href=" scrolling="no" frameborder="0" style="border:none; width:450px; height:80px"></iframe> However, to make it work properly, because the button posted an error saying the button was on...

What else can I use instead of arguments.callee ?

function runProcess(){ var todo = items.concat(); setTimeout(function(){ process(todo.shift()); if(todo.length > 0){ setTimeout(arguments.callee, 25); } else { callback(items); } }, 25); } I tried to refactor this block into a function function doWork(todo){ ...

convert string to json array

I get this response from an Ajax request. Javascript seems to intepret it as a string. (When I say alert this.responseText, the whole string is shown) How can i convert it to a javascript object (JSON)? {"response": { "success": "The activity has been removed", "message": "0" } } I am not using jquery. ...

Is there an API available for SharePoint 2010's JavaScript based Client Object Model?

I've searched the farthest reaches of the internet, but I cannot find an online API for SharePoint 2010's JavaScript based Client Object Model. ...

How to set a timeout for finding location with geo.js?

I use geo.js in my webapp to let user share their location. In most browsers it works fine, however in Safari it usually hangs up. I know there's timeout in HTML5 geolocation, is there such thing in geo.js too? Thanks! ...

Issue with Facebook Like button in Windows Firefox

Hello all, I've got a facebook like button ( iFrame edition ) that is overlaid on top of a full browser Flash application. The like button is hooked up to like separate images within the application, and when each new images is shown, the like button is refreshed with data using ExternalInterface. The like button fades in and out for e...

Setting cookies using Javascript in IE8

I want to set cookies using javascript that should not expire for some time. I create the cookie using the code below. These cookies are available in firefox across browser session (browser restarts). However, all cookies seem to get lost in IE. I want to set the cookie using javascript only. I alerted document.cookie on page load. In a...

How can i pass values to a javascipt array?

I am trying to implement the autocomplete method for textboxes. I would like to use the example based on jquerys autocomplete provided here <head> <link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/j...

Remove search option filters jqGrid

I'm trying to set few filters to search with this: $.jgrid = { search : { caption: "Search...", Find: "Find", Reset: "Reset", odata : ['equal', 'not equal'], groupOps: [ { op: "AND", text: "all" }, { op: "OR", text: "any" } ], matchText: " match", rulesText: " rules" }}; But I cannot get it to work. It is still listin...

Implementing comet on the client side

I'm trying to implement comet in my application and, being inexperienced with JavaScript, I'm not sure how to do the client side. When the server receives a request, it just keeps it open and writes data to it when necessary: def render_GET(self, request): print "connected" request.write("Initiated\r\n") reactor.callLater(r...

Can jQuery copy an element's bounds (position, size, margins, etc.) to another element?

I have an element of an arbitrary type. I'd like to create another element, of either the same or a different type that has the same position and size as the first. The element may or may not be positioned. For example, I might start with a <select> with a certain size, possibly dependent on its contents, i.e. width/height auto. I wa...

jquery: stop function immediately

when mouseover .down, the div layer slides down when mouseover .up, the div layer slides up If the mouse goes over .b, how do I get the div to slide down without having to wait for the div layer to slide up first? basically kill the previous function immediately <a href="#" class="down">Slide Down</a> <a href="#" class="up">Slide Up<...

what's wrong with this javascript object?

I think it's fairly clear what I want to do here: var viewnames = {}; viewnames['region-a'] = "Region A"; viewnames['region-b'] = "Region B, partial"; viewnames['region-c'] = "Region C"; function loadView(view_name) { alert('view_name: ' + view_name); alert('viewname: ' + viewnames.view_name); document.getElementById("viewt...

jQuery Not to show Year on the Datepicker?

How can i possible not to show the year entry on jquery Ui datepicker. now its show as Oct 2010, but i just need Oct. is it possible?? ...

How to assign file contents into a Javascript var

ok, this is simple, but I kinda need a noob's help. I'd like to do something simple: To assign an HTML file contents to a JS var, and then to pass this html code into a page element using the innerHTML property. This can be done easily with HtmlHTTPRequest, however, i'm not sure what is the exact code i should use. here's what I'd lik...

Purpose of (fn...)() brackets in Self-Executing Anonymous Functions? [JavaScript]

Possible Duplicate: Location of parenthesis for auto-executing anonymous JavaScript functions? Question is a duplicate of http://stackoverflow.com/questions/3384504/location-of-parenthesis-for-auto-executing-anonymous-javascript-functions and http://stackoverflow.com/questions/440739/what-do-parentheses-surrounding-a-javascr...

Better syntax highlighting for js.erb files in Textmate

I'd like Textmate to highlight Ruby syntax inside <% %> tags in *.js.erb files (like it does in *.html.erb files). Right now it looks like this: As you can see, everything within the quotes is treated like a regular JS string – annoying. ...

How to Detect IE7/IE8 "run as administrator" mode with Javascript

How to Detect IE7/IE8 "run as administrator" mode with Javascript? I have a html page that needs to be run in administrator mode. I can detect if it is ie8/7 and when that occurs I pop-up an alert saying the user must be in administrator mode for the page to work (because it runs an active-x that doesn't work other wise). That, howeve...

jquery problem?

i have this jquery problems i have had for days, im so new to this, so excuse my dumbness in this subject. thanks :)) html code: <ul class="statuses"> <li id="set_23" class="message"> // this is meant to increase everytime you click the vote_up just like stackoverflow <span class="vote_count">27</span> <a href="#" class="vote_up...