jquery

Javascript function that returns a DOM when input is html content

Hello, I want a Javascript function that returns a correct DOM when input is HTML content. I have used the follwing function for the same. Here input is HTML content and output is DOM. function htmltoelement(elementHTML) { var temDiv = document.createElement('div'); temDiv.innerHTML = elementHTML; return temDiv;...

How to print Array data retrieved from Database using JQuery

Hi all, I am using cakePHP 1.26, and JQuery. In a TestingController, I got this line of code function testing(){ $r = $this->User->findallByuser_id(1); } and I am using JQuery Ajax to retrieve the data from function testing(): $.ajax({ type: "POST", url: curl, success: function(data){ alert(data); ...

passing an input field value through a querystring using jquery

I trying to store the value of the input field tbEmail into str so when the user clicks the submit button the value of tbEmail will be added to the querystring. If i change this so that it reads var str = "this"; then this works. Is this the incorrect way to get an iput field value in jquery? Any ideas? <script type="text/javascript"> ...

My first dig at jQuery

I'm a complete newbie as far as jQuery is concerned. I also don't know much of JavaScript except for some very basic stuff. I'm following this tutorial here: http://docs.jquery.com/How_jQuery_Works And nothing's working! :-) I created a folder on my machine's hard drive here: C:\rnd\jQuery Then, in that folder, I put the jquery.x.x.j...

jQuery ignore transparent areas of images

I want to make something to what has been done here: http://www.cw-internetdienste.de/pixelselection/ However, it doesn't work if I just copy the pixelSelection.js file from this site. I would really like to make my own, not just something somebody else wrote, but am clueless how to do it. I've tried .svg and image mapping together, ...

Form in Thickbox Refresh Parent On Submit

I have a form sitting in a Thickbox modal in a Symfony project. I am trying to make it so that when the user submits the form, the modal closes, form submits and the parent page refreshes to show the new data (saved to the db). I added to the function tb_remove() parent.location.reload(1); This looks like it refreshes the page, but i...

Help setting up image upload in CK Editor, using jquery config.

I have been trying to set up CKeditor with Perch CMS which requires using jQuery adapter option for initialising the CK Editor. Below is what I have as my configuration options for CK editor and my upload folder is "resources" which is located in my root folder e.g. domain.com/resources Although the upload tab appears under the image b...

Creating jquery plugins...

Hi there I am trying to create a jquery plugin to do ajax table pagination (i.e get the data and recreate the tbody when it is called. Can anyone suggest a tutorial that will show me how to do all these things? I am looking to adhere to the following points: 1) The plugin is to use the jquery ui syntax 2) The plugin needs to be usea...

jQuery .animate() forces style "overflow:hidden"

jQuery .animate() forces style "overflow:hidden" when triggered, messing with my animated element because I have another element that's hanging, with negative position, outside of it. is there anyway to avoid that? ...

jquery with jsf

Hi I have a problem integrating JQuery with JSF. I use Spin. and I have in my code: <script type="text/javascript" src="#{request.contextPath}/scripts/jquery.selectbox-0.5.js"></script> jQuery(document).ready(function($){ $.spin.imageBasePath = '../images/spin1/'; $('#spin1').spin(); $('#spin2').spin(); $('...

Setting jQuery focus

Problem I'm trying to do an effect where a pop-up appears when the user mouses over. The focus is then set on that popup. When the user does a focusout of said pop-up, it disappears. Example You can view a working example below, but you'll need to login as "testuser" in both usernames and password fields. Hover the login box once logg...

How to store data of complex types for use in Javascript?

This is a reoccurring theme: either AJAX causes data to be requested from the server and then the data is shown to the user or the page is pre-populated (ie. rendered) with data that has some kind of interaction with Javascript. Here are couple of possibilities I see how to store and manipulate the (complex) data: Store the data simpl...

Sending a value from a dropdown box to PHP via jQuery

Hey guys, I'm trying to take values from a dropdown two boxes and send them to a PHP file which will draw an appropriate field from a mySQL database depending on the combination chosen and display it in a div without refreshing the page using AJAX. I have the second part sorted, but I'm stuck on the first part. Here is the HTML: http:/...

How does $(this) work in jQuery

How does the jQuery tag $(this) exactly work? I know how to use it, but how does jQuery know which element is 'active'? And what is the original Javascript tag for getting the current item, or is it jQuery only? ...

[jQuery] Removing event handlers of children

I am trying to unbind event handlers (click) from all a-tags, and somehow it is not working. Do you guys know why? // Remove eventhandlers row.find('a').each(function(){ $(this).unbind('click'); alert($(this).attr("onClick")); }); It will always output the current onClick function. Thanks ...

Image gallery with codeigniter

Hello there , I have some images uploaded in a folder on my server, and their paths are stored in a table in my database. Whats the best way to display this images on the browser(as a gallery)?Should I use jqery or maybe codeigniter could do the job?Please provide some examples or resources..Thanks! ...

How to get a parent element's index in jQuery.

Hi. I'm having some trouble writing a jQuery function and could use a little help. Here's what I'd like to accomplish: I have a ul element with 5 li children. Elsewhere on the page, I have a container div with 5 div children. When I click a link in the third li, I'd like to hide the other divs and show only the third one. Currently ev...

When an object is hidden in jQuery, surrounding elements snap in to new positions. How can I make them animate into new positions?

I have a list of say, 20 items. Each of them are boxes in 3 columns, like a grid format. Above the grid are options which allow you to show and hide different items within the list, depending on what you are looking for. When a user hides specific list items, they fade out and all of the other items snap into their new positions. Afte...

Alternative to "this" variable.

I am trying to write a simple script in JavaScript, just for testing purposes. I am defining 2 variables, sort of unnecessary, but nice anyway which hold string values for two different scenarios, if the element before the button contains bold text when the button is clicked, the respective variable will be displayed in an alert dialog ...

Strip "http://" from pasted text into textbox

Hi! I'm a total newbie when it comes to Javascript/jQuery so hopefully you can help me. I have a textbox where most people are gonna paste links into. Is there a nice way for the textbox to detect that a link has been pasted (starts with http://) and then remove the protocol dynamically in the textbox without having to push a button or...