jquery

Simple Multiplayer game in Ruby on Rails?

Hi guys, I have created a simple card game in Ruby on Rails+ajax with jQuery for animation. It's working Ok, and I wanted to develop a multiplayer version. It looks like it's not so simple as i thought. I have also tryed to port the game completely to JS into the Canvas tag. This is possible for me and I could make the animation there ...

Converting a string

How do I convert a string This: file:///C://Program%20Files//Microsoft%20Office//OFFICE11//EXCEL.EXE To this: C:\\Program Files\\Microsoft Office\\OFFICE11\\EXCEL.EXE ...

jquery displaying an unnested div using nextall

Hi, having read through how to use nextall() i'm still a little stumped with the following: I have a loop that will be outputting the following code. <div id="placement" style="float:right"> <a class="eng-sum"><img src="/flags/en.png"></a> </div> <div class="tool-summary" id="tool-summary" style="clear:both; display:none"> bla...

How do I show a specific tweet? (with PHP/jQuery)

Hi, I want to embed a specific tweet on my page e.g http://twitter.com/myusername/status/123465678 I would also like to be able to show the latest of my tweets which have a specific tag. I tried to do this with Twitter API CodeIgniter Library myself but I need to register my application with Oauth. This seems like overkill for embeding...

Loadin CSS dynamically - jQuery vs plain Javascript

Hi, I'm loading CSS file in java script code. At first I used jQuery code. It worked fine, but after somet time I realized that CSS rules are not applied in IE browser. So I googled and replaced it with document.createElement version. Now it works smoothly in all browsers. Anybody knows why? Is there a difference in those two approaches...

:contains() works fine in Opera, IE (7,8) and Chrome but in firefox

Hi I have written a search filter. It shows/hides some thumbnails in a video gallery based on text typed into an input field. Te input field has a keyUp event. $('.videoSearch').keyup(function(e){ var searchString = $(e.srcElement).val(); var el = $($(e.srcElement).parents().find('.videoThumbs').first()); $(el).find(".title:not(...

Problems Passing Multiple Parameters to Web Service

I have a simple Web Service method defined as: [WebMethod] [ScriptMethod(ResponseFormat = ResponseFormat.Json)] public string MyWebMethod(string foo, string bar) { // DataContractJsonSerializer to deserialize foo and bar to // their respective FooClass and BarClass objects. return "{\"Message\":\"Everything is a-ok!\"}"; }...

jQuery Scrollable Pagination

Hello! I just wanted to know if somebody knows some jQuery scripts that do some effect like this one: http://tympanus.net/codrops/2010/05/23/fresh-sliding-thumbnails-gallery-with-jquery-php/ I mean the scrolling thumbs. as I'm developing a website with pagination and when it comes to style I don't want that multi-line pagination links....

Advice on creating a MVC Helper for the jquery UI accordian

I want to create a mvc helper method for the jquery UI accordian widget. Any advice on how I should design it for re-usability? ...

Jquery: function doesn't allow to be appended

I'm trying to insert the jquery function tweetable into a specific place in my HTML. The documentation says something like this: $('#twitter').tweetable({username: 'username'}); The problem is that the tweetable HTML is placed before anything else inside the #twitter ID. In my case I want it at the end, so I tried this: $('#twitter')...

<textarea> scrollHeight is comming zero on body load

Hi I wanted to get <textarea> scrollHeight on body load using jquery. It's always getting zero. I want actual height of textarea on body load. If it's not possible to get scrollheight on body load, is ther any way to get actual height rather than height(). Please suggest if you have any reference. Thanks -Pravin ...

Jquery Movable/Dockable navigation

Does anyone have any good suggestions with regards to movable / docakable navigation in JQuery. I have a requirement to allow the user to move their navigation and have it dock to the top, left, right or bottom of the screen. Thanks ...

On page load jquery

I have a jQuery click event which runs when an element is clicked. Is it possible to get this to run once when the page is loaded? ...

jquery toggle can't be used with live, then how can I toggle images with live function?

The following code works fine when it is first loaded. However when I use ajax, then the toggle does not work. I found that I am not able use toggle with .live function. How can I change this code with using live function? This code toggle a div to show and hide and the same time change the icons up and down. Thanks in advance. $('...

How can I add callbacks to jquery validation (when used in MVC 2)

I'm using jquery for validation in my MVC2 web app (as described here) and I'd like to wire up some callbacks that the jquery validation plugin supports, like invalidHandler, etc. I can manually edit the MicrosoftMvcJQueryValidation.js and add my callbacks (in __MVC_EnableClientValidation, in the options variable) but I was looking for ...

How to disable Firefox's default drag and drop on all images behavior with jQuery?

Firefox has this annoying behavior that it let's the user drag and drop any image element by default. How can I cleanly disable this default behavior with jQuery? ...

Submitting a form via Ajax/jQuery

Hi, I have built a simple login form via ajax (jquery), but the submitted values (the users email address for login purpose, not the password) are not stored. So the second time the user tries to login he has to write his full email address instead of using the stored email address. Is this normal with ajax form submission and (more im...

No response from MediaWiki API using jQuery

Hi. I've tried to get some content from Wikipedia as JSON: $.getJSON("http://en.wikipedia.org/w/api.php?action=query&amp;prop=revisions&amp;rvprop=content&amp;titles="+title+"&amp;format=json", function(data) { doSomethingWith(data); }); But I got nothing in response. If I paste to browser adressbar something like that: http://en...

Placing a couple of custom Jquery Functions into an external Script

Hi all, I have the following two functions and i need help moving these into an external file. $.fn.clearSelect = function () { return this.each(function () { if (this.tagName == 'SELECT') this.options.length = 0; }); } $.fn.addItems = function(data) { return this.each(funct...

How do I toggle the display for a dynamic id table?

I have a table that displays rows based on a drop down list option. The rows are dynamically created. I use the value on the ddl for the initial row, then a simple counter to make it unique. Is there a way to say something like show all the rows that start with "tableShoes" even though the rows are something like tableShoes1, tableShoe...