jquery

My PHP page randomly downloads instead of running normally in the browser...but not always

I know what causes a PHP page to consistently download instead of running normally, but I have no idea why it would only sometimes download and sometimes run normally. It appears to be purely random: I just keep hitting Refresh until it stops trying to download and runs normally. This page has a lot of jQuery/AJAX scripting running on i...

How to pass javascript variables from one html page to other html page

I have the following code to pass variable from example1.html to example2.html , what will be the syntax in window.location.href to navigate to example2.html with username and keyword. example1.html <script type="text/javascript"> var username = ($("#username").val()); var keyword = ($("#keyword").val()); $("#button1").cli...

How do get my ajax form to inject captcha verification into the browser after successful form validation?

Currently after my form has passed validation it forwards to an html page. I would like to have one last step that pulls reCaptcha and when reCaptcha has been passed only then is the registration details of the user sent to my database and user forwarded to what ever page I choose. Please advise me on the best way to do this thanks...

Handling JSON in JS/ERB template in Rails 3

I have no trouble making typical AJAX calls to and from Rails(3) with JSON objects and jQuery-rails (jQuery library plus a special rails.js file). In one controller, though, I want to RETURN some JSON in an erb template (create.js.erb) after an AJAX call. I've tried every combination of things in the controller (@object.to_json, '[{"co...

Approaches for embedding script required data in markup

What approaches can be used to embed additional meta data in HTML markup, where that data is required by client side javascript. Some simple examples of what I mean: A list of contacts which when clicked shows their position in a map. ie: how to associate a lat/long with each contact. A set of images which when clicked pops up a drag...

Ajax call not working in mozilla

My code is working fine in all the browser except mozilla firefox $(document).ready(function () { var id1 = '<%=ViewData["UserName"]%>'; var id2 = '<%=ViewData["UsrProfile"]%>'; var msg = $('#addFrnd').attr('value'); $.ajax( { type: "POST", ...

jQuery - Draggable and different screens (fit to screen)

Hi, I have many draggable div's on my page $('#bibo').draggable({ addClasses: false, containment: 'window', zIndex: '999', stack: '.tko.sto' }); I save the new position on dragstop and put the new top and left values into the SQL. Ok, everything works great. But when I visit my Page with the Laptop (small screen) som...

Download file in javascript is not working in Chrome.

below is the code function ExportToExcel() { if ($("#dateRange").val() != "") { var frm = $("#frmProjectReport").serialize(); var url = "/Reports/ProjectExcelReport?" + frm; Download(url); } } function Download(url) { alert(url); ...

Javascript newbie question.

Hi there, i am using a jquery plugin to upload files, the plugin checks the file dimension and return back the appropriate error message. the error message i am displaying is with this code. $('#divmsg6').append("<p class = 'red'>Incorrect file dimension, try again</p>"); now if the user keep on trying the error will keep on appendin...

How to count DIV element and insert break line

I would like to insert a break line after the second or third DIV element. Any ideas how to use Jquery ot do that? Thanks <div class="column"> <h3>Web Development</h3> <ul> <li><a href="http://www.javascriptkit.com"&gt;JavaScript Kit</a></li> <li><a href="http://www.dynamicdrive.com/"&gt;Dynamic Drive</a></li...

Add empty row to the jgrid

Hi, i am jsgrid i want have implemented the add row button. when i click on thet button its open the form in dialog box with submit and cancel button. i just want to add the row in in jqgrid. i dont want to save it to database how can i achieve this. Thanks ...

jQuery .ajax call fails when '0' is entered

I've created a guess-the-number game using jQuery and PHP, and while it works fine when a number is entered (and also handles non-numbers well), when 0 is entered the Ajax call fails. As far as I can tell, when 0 is entered the variable $guess sent to the server-side code isn't set properly, but I can't work out why - any ideas? Form in...

Create unordered list of dynamically loaded objects using jQuery so that I can use 'sortable' of jQueryUI

Hi, I am loading dynamic objects in the DOM. How do I keep adding them dynamically to an unordered list using jQuery ?? ...

Jquery img preload not working in FireFox

Hi. I recently did a small jQuery snippet that allows me to show a loading img until the real image is loaded. The snippet seems to work in Safari, Chrome but not FireFox. FireFox only displays a loading alt and never switches to the loaded image. Here is the snippet var loading = $('<img src="/media/ajax-loader.gif" alt="loading" /...

Set selected on select change with jQuery

A kinda funny problem, im doing a .clone() on a select-element (for preview purpose) and the selected value isnt transferred. I.e my solution is to set selected="selected" on selectbox change. But, i can't get it to work in any form. Ideas? $("select").change( function() { $(this).find("option:selected").attr("selected", "selected"...

Defining a specific field value as semantically equal to empty in jQuery validation.

Hi! I have a very large Form with many date fields that need to be validated. For the most part, this is pretty straight-forward to do with the jQuery Validation plug-in. But I have found a use-case, where I am not exactly sure that the "correct" design decision is: I have a date-field whose value is by default an abstract example : ...

How to store dyanamic value into jquery cookie variable

How can we store dynamic variables into cookie . var username = ($("#username").val()); how to store the variable username into jquery cookie variable $.cookie('username', '+username +'); alert($.cookie('username')); ...

JS/JQuery library that allow to show dynamic table information

There are at least 2 ways to show and reload information in table: -to rebuild table each time when new data arrives; -to update table's cells if they changes, adding or deleting rows one by one if needed. I've used the first approach, but now I want to add some JQuery UI effects, but I don't think that adding a "slider" or "selectable" ...

Copy cell value from table to textbox

I have the following table. I want to copy Id value on the seleced row to the text box. If I click on link "Select" in the first row the text box value will 0001. If the table needs modification to get result better and faster, please leave your suggestion. <div> <input id="selectedId" type="text" /> </div> <table cellspa...

jquery ajax problem

Hi again everyone, thanks for every help that you guys have given me so far !! :D and now, i encounter some problem on me using jquery and ajax i am fetching all of my user's photos from my database, calling them out into a grid and then applying a jquery pagination plug-in 'pajinate' using this code $(function(){ $('#talent_pagin...