[jQuery] jChess
I've written a jQuery app that will draw a chess board and let you play chess currently requires two players on the same computer. will be updating it to use a server via AJAX to allow you to challenge friends to a game online. Current games available {standard chess:8x8, Omega chess:10x10 & Grand chess:10x10} check out wikipedia for what they are. I'll soon be wanting to release the first version of the plugin which lets you choose what type of game you want to play but I would love to upload to
Question on transmiting data to the server
I came across with this problem. When I send to the server via $.get() [So far, the $.post() and $.ajax() have been used to send form with post data] a little amount of data [2 or 3 var=val pairs] with some special chars, such as ñ, í, ó [Common in my language] I get at the server side strange characters instead, such as "ñ" instead the ñ. I've reading about and realized that is because of the use of the XmlHttpRequest Object which uses UTF-8 encoding. All of the encodings are UTF-8, browser, .html,
scroll to top
Hi all, I got stuck at the moment with a scroll to top slider, It slides fine but when i click the scroll to top div it's stay on top and i can't scrll down can someone help me out? amorz var amorzScroll = null; $(window).scroll(function () { var scrollTop = $(document).scrollTop(); scrollTop = parseInt(scrollTop); var offset = amorzScroll+scrollTop+"px"; $("#toplink").animate({top:offset},{duration:700,queue:false}); $('#toplink').click( function (e) { $('html, body').animate({scrollTop:
How do I show elements having two classes?
Right now I have something of the form in my CSS: .a { display: none } and in my HTML <tr class="a b">... How do I show all items belong to classes "a" and "b"? Right now I'm trying: $('a,b').show(); Is this the right approach, or should I be doing something else? Jonathan Hayward
images not showing up in tabs problem in IE
I have to make tabs without the ui-tabs, just simple tabs. I'm doing it using the visiblity css property. Works perfectly in firefox and chrome. In IE images don't show up if they are located in the tab body, but space is allocated for them, it's just blank. any help you can give would be greatly appreciate. here is the css that applies: .news.selected { visibility:visible; position:relative;
Refresh??
Using PHP and Ajax with Jquery to submit a form into a hidden div, after the form was submitted i want the page refreshed automatically. I cannot use meta method because it cant be inserted into the head tags. How do I do this??? I have been googling for over an hour!
How can I hide certain tr's?
I am working on a webapp that, if there are more than 10 rows to a table, has any rows in excess of 10 initially hidden, but discoverable via clicking on a link. In the source, I marked the rows that should be hidden with two classes, one of them named "additional", and tried the following: $.ready( function() { $(".additional").hide(); } ); That didn't seem to do anything. So, as a test, I moved the script to the bottom of the page and simply had: $(".additional").hide(); That still didn't do anything.
Scroll to top Slider
Hi all, Im getting stuck on a scroll to top slider. It works fine only when i click the scroll to top button, it's stay on top of the page and i can't scroll down without refreshing the browser Please help me amorz var amorzScroll = null; $(window).scroll(function () { var scrollTop = $(document).scrollTop(); scrollTop = parseInt(scrollTop); var offset = amorzScroll+scrollTop+"px"; $("#toplink").animate({top:offset},{duration:700,queue:false}); $('#toplink').click( function (e)
do i need to remove handlers before removing a DOM element?
if i use jquery to attach a click or keyup handler to an element, and then later remove that element form the DOM, do i need to clean up/remove the handler first?
If Then Statement not working within a success function.
Hey All, Just wondering if someone could tell me why my page is not redirecting within the if then statement, here is the code. function addComplaint() { var datastr = $("#h3sForm").serialize(); $.ajax({ type: "POST",url: "http://oscscar02/functions/addComplaint.php", dataType: "html", data: datastr, success: function(html) { top.alert('Complaint Form Added'); $('input[name=subBut]').attr('disabled', 'disabled');
Getting Id value with # appended.
Somewhat of a beginner question but in searching around I cannot find an answer. In a situation where I am trying to retrieve a clicked objects id I would use the method below: $(this).attr("id");However, the id value I am always getting back is lacking the # sign which I need to append like so: var id = "#" + $(this).attr("id");Then I can utilize the id value. I understand I can just use $(this) to manipulate the object but in certain cases I'd just like the Id value. Just curious and looking
document.write function with jquery.load() not working
Hello, im trying to get the ajax .load() function working and its working correctly, but if i put a document.write function on a page that is getting requested through the .load function it doesnt load? part of my iphone.js looks like this function loadMenu(user) { window.scroll(0,0); $('body').append('<div id="progress">Loading Menu...</div>'); $('#container').load('loggedin.php?user='+user, hijackLinks); } function loadPage(url) { $('body').append('<div id="progress">Loading123...</div>');
Cascading call into a REST Web Service - best way to approach it
I am using getJSON to retrieve data from a REST web service. Works fine with one call, but I'm confounded on my approach to obtaining data when I need to hit another REST web service while cycling through the first call. To pseudoecode this: Call REST Web Service Cycle through JSON return to build output When get to the state code Call Rest Web Service for States with the State ID from 3 Return the State Info Output State InfoThe code I have so far which breaks down at the GetStateInfo because of
index of a selected item in a list
based on the code below, when a radio is clicked, how can i tell if it was the first, second, third or fourth in the list (using jquery functions, not string compares against values)? feel like it should be obvious... <html> <head> <script src="js\jquery-1.3.2.min.js" language="javascript" id="javascript"></script> <script> $().ready( function() { $(':radio').click(function(){ // how do i know which radio? alert($(this)); });
Form wont submit in Firefox, works in IE
A simple online registration form, using php validation and jQuery 1.3.2. It works perfectly in IE, but not in firefox. when you click the submit button absolutely nothing happens. Please help. Thank you in advance <script type="text/javascript" src="js/jquery.js"></script> <script type="text/javascript"> // <![CDATA[ jQuery(document).ready(function(){ $('#registrationform').submit(function(){ var action = $(this).attr('action'); $.post(action, { organizationname:
Toggle slider with external files (live issue?)
Hi guys, I'm trying to create a really basic accordion/slider as a header for my site. There are two different banners, the big one (banner_a), and a small version (banner_b). banner_a initially starts open, and banner_b hidden. When a user clicks the .toggle button, I want banner_a to slide close, and then banner_b to slide open and vice versa. I have got this working okay. My problem comes as each banner has quite a lot of content, so I want to to use two external files banner_a.php and banner_b.php
unwrap... doesn't seem to work for me.
I am passing the name of a div when clicked to a function. This function wraps the div around another div and is then meant to unwrap the div... however the unwrap does not work... I know htis is a pointless exercise, but please humour me. regards J $('.slideDownBtn').click(function(){ wrapFunction('.testDiv');}) function wrapFunction(divToSlide){ divToSlide=$(divToSlide); divToSlide.wrap('<div class="jwrapper"/>'); divToSlide.unwrap(); }
dividing XML on variable
Hi.. i'm trying to get xml content divided on a number with paging.. like if i want to divide it on 4 i will get 4 pages with paging navigations numbers.. can we do it ?! $(document).ready(function(){ $.ajax({ type: "GET", url: "file.xml", dataType: "xml", success: function(xml) { $(xml).find('Chapter').each(function(){ var id = $(this).attr('VerseID'); var Verse = $(this).find('Verse').text(); $('<div class="items" id="link_'+id+'" ></div>').html(Verse).appendTo('#page-wrap'); }); } }); });
jQuery ajax form submit - how to ensure dynamically loaded form’s action is used
Hi, i'm having a problem with dynamically loaded forms - instead of using the action attribute of the newly loaded form, my jquery code is still using the action attribute of the first form loaded. I have the following code: $('input.next:not(#eligibility)').live("click", function(){ $(".form_container form").validationEngine({ ajaxSubmit: true, ajaxSubmitFile: $(this).attr('action'), success : function() { var url = $('input.next').attr('rel');
video in a dialog box
Hi all, Can someone tell me if it's possible to use video (flv or something else) in a dialog popup? (maybe point me towards a link with info... I searched it but couldn't find anything) thanks
Is there something like event.continueDefault();. I need the opposite of event.preventDefault();
Hello I have this function which prevent the default envent of a link. So far is ok. Then the function execute some tasks and then I need TO CONTINUE with the event with something like event.continueDefault(); Can I do this? Something like: $('.link').live('click', function(event) { event.preventDefault(); // STOP THE EVENT ...//EXECUTE SOME TASKS event.continueDefault() // LET THE EVENT CONTINUE. Of course, this line doesn't work. });
Auto-Selecting Navigation works for active page but how to add class to parent menu items?
I am following this article http://docs.jquery.com/Tutorials:Auto-Selecting_Navigation I am able to successfully add a class to the active page menu item but does anyone know how to modify or add to this script so that any parent menu items also get the active class? here is my menu structure and code so far * Menu * <ul class="topLevel"> <li><a href="/one.html">one</a></li> <li><a href="/two.html">two</a></li> <li><a href="/three.html">three</a></li> <li><a href="/four/">four</a> <ul
jQuery removing script tags
Hi, I'm trying to load some HTML and Javascript from another document, using such code: var $contents = $('<div></div>').load('mydocument.html #divMainContents', function() { // Success callback alert('Value:' + $(this).html()); });Assuming mydocument.html #divMainContents has some DIVs and a SCRIPT tag in it, jQuery is removing the SCRIPT tag when it's displayed via the alert(). I assume this is done directly by .load(), or because it uses .html(html) to set the loaded HTML, and that method
fade trainsition with time limit
Hi I have 3 divs one below the other and each div has to be rolled out after 10seconds so could anyone of u help me out jquery code Thanks in ad Sruthi
Jcarousel too slow for me
Jcarousel image/content loading too slow, MYURL This is my URL , My carousel content loading is too slow... How to increase the speed Thanks
jQuery causing problems in IE (only IE)
Hi guys, any help will be greatly appreciated... The problem: The site in question heavily uses Javascript, there are more than a dozen scripts executing. Everything works fine in Chrome and Firefox 3.5+...but, in IE there are several problems: - Hover effect over table elements is painfully slow in IE (only IE) - Very high processor usage on mouseover - Flash animation pauses/stops when moving mouse over table elements (making flash banners on the site impossible -> big problem) You can se the
hebrew problem via $.ajax() in IE
hi i'm tring to request data from a php file by sending url whit hebrew parameters exmple: $.ajax({ type: 'POST', url: 'test.php?name=עידן&type=7', contentType: "application/x-www-form-urlencoded;charset=UTF-8", success: function(data) { //some code } }); in firefox i'm geting the "name" parameter fine buy in IE8 i'm geting empty string someone knows why? sorry my english is slow!
How to show reflection of text
Hello all, I want to show reflection of only text which is lets suppose heading. <h1>JQuery</h1> Can any one help me out in this regard. thanks Naveed Ramzan
Sortable Handle - Child Element Only?
Hi, I'm trying to set a Handle for my Sortable List. I know that you need to use handle : '.handle', and give something a class name with handle. However, while this works, the rest of the LI still shows the default drag icon, rather than limiting it to just the specifed handle. Any idea what I need to change? <div id="example-1-4"> <div id="containment"> <div class="column left first"> <ul class="sortable-list"> <li class="sortable-item" id="A"> <img src="move.png"
targeting a div as content for JQuery lightbox
Hi I have a JQuery lightbox popup but am struggling how to control the content of the lightbox. all the examples given on the internet are from anchor links that are fixed. I however, need to use it from images pulled from the database so therefore the content will be different depending on what image is clicked. I already have the content I need in a div, so is there a way of targeting that div so it is displayed within the lightbox? thank you in advance for your help, im very new to JQuery but
actual html after load or get
Hello forum, if I do load or get function and will refresh some div on page, so if afer that I use $(document) work it with actual fresh html or with old version? How do I need to do work with actual fresh html? thank for replies Petr, CZ
Please help me with a browser window FOCUS issue
I am working on a session timeout javascript functionality. I have a parent page with a timer that brings up a custom jQuery yes / no dialog after an alloted amount of time. If I have a child browser windows open and I am focused on one of them, when it comes time for the timeout to appear on the parent page, I want that window to come into focus. Currently, when a child window is open, the timeout dialog will open in the parent window but it remains behind the child window, and I want it to always
IE fade: crucify me if you want
I know I know.... yes I have searched every forum known to mankind and tried every suggestion! Setting the background colour really works: except it makes for very limited use (I very rarely have a png with transparency sitting on a flat colour background). Before I give up and just try to pretend that fading doesn't exist I thought I should ask: I am right in thinking that there is no way to fix the IE bug with fade on transparent png images?
Catch request
Hi guys, Is there any possibility to catch ALL new url request events ? Like, when i click on link, script will stop redirecting. But I don't want to declare precisely( ex. $('somethin').submit(); ).
onSubmit doesn't work.
Hi guys, im a extremely newbie user, please be pacient with me. im making a smarty php mysql web page, at first im using prototype for ajax, but hace problemos with other js libraries(like wysiwyg editors), and now im using jQuery. first, i change the function new ajax.updater() from prototype for $().load(), its works fine when using onClick, but does not work with onSubmit. whyyyyyyyyyyy??????? excuse my bad english, and help me.
jQuery .blur() form problem...help!
Hey guys, I'm either having a dumb moment here, or I just can't find the answer, but I've written a script using jQuery that takes the elements of my form, checks to see if the default value is currently displayed on focus, if so the field is set to blank. My problem is on blur. I want to loop through my default value array, find the name that corresponds to the input name, and add the default value to the input field. Hopefully this makes sense to you guys, I've attached the code below: var defaults
Changing the inner html of an object (i.e. an iframe)
I'm using the modern equivalent of an iframe... <object data="page.html" type="text/html" id="myiframe"></object> and i want to change the the iframe's contents. In the past, with real iframes, i'd have... <iframe src ="page.html" id="myiframe"></iframe>and the jQuery to change its contents... $('body', $('#myiframe').contents()).html(myNewHtml); ...which worked perfectly. Not so with this new object type of iframe. Anybody know how the hell to do it??
Simple function not working as expected
Hello, I wrote a function to check and see if a certain radio button was selected, and I'm passing an item from an array of HTML objects that I'll add to as I get more elements to check. Anyway, here's the code: (function ($) { var active; $.fn.checkRadioButtons = function (item) { return this.each(function () { return active = ($(this).attr('value') == item.value); }); } })(jQuery);When I console.log the resulting item, it says,
isajax flag
I'm adding is a flag to indicate that a post was sent via ajax. Is there a better way to do this so that I don't have to add the flag every time an ajax form is posted? var param = $("#"+frmId).serializeArray(); param.push({"name":"isajax","value":1}); $("#shoppingcart").load("/catalog/shoppingcart.php", param);
Click should only work on parent UL not sub UL
Hi there. I've a navigation menu that has some sub-menus and I want to show them only after a click on the parent link. But every click on the sub-menu collapse the menu again. $('ul#nav>li:has(ul)').click(function() { $(this).children('ul').slideToggle(); return false; }); <ul id="nav"> <li><a href="#Home">Home</a></li> <li><a href="#Products">Products</a> <ul> <li><a href="#Apples">Apples</a></li> <li><a
Next Page