jquery

Can't add Google Maps DOM listener to element created using jQuery

I have the following script that creates a div, adds a Google Maps DOM listener, and appends it to another div to another div using JavaScript's built-in DOM manipulation methods: var div = document.createElement('div'); var html = '<b>' + string_of_text + '</b>'; div.innerHTML = html; google.maps.event.addDomListener(div, 'click', func...

How to scroll the browser window

I am using C# code and displayed the Page and when i click on the link button on the top of the page then the page should scroll to the bottom of the page because the related content will be on the bottom of the page. How can i achieve this can u give me the solution for this scenario either programatically in c# or in jquery Thanks ...

Problem with jquery ui tabs

I am currently learning jquery ui tabs and included following things MY index file <!DOCTYPE HTML> <html lang="en"><head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <meta charset="UTF-8"> <title>jQuery UI Tabs - Open on mouseover</title> <link type="text/css" href="mouseover_files/jquery.css"...

Client Path of uploaded file or image?

Here is what I am trying to make. Whenever a user browses a image from a file field. I want to grab the clients path and show it on the page so that user can be certain of what image he choosed, before uploading it. ...

JavaScript: Global variables after Ajax requests

the question is fairly simple and technical: var it_works = false; $.post("some_file.php", '', function(data) { it_works = true; }); alert(it_works); # false (yes, that 'alert' has to be here and not inside $.post itself) What I want to achieve is: alert(it_works); # true Is there a way to do that? If not can $.post() retu...

ui.size not working in draggable() jquery-ui

For some reason I am getting a 'ui.size' undefined error. Here is my code: $('.canvas').draggable({ containment: $('.canvas'), refreshPositions: true, drag: function(e, ui) { area.css('border', 'none'); }, stop: function(event, ui){ var pinpointHeight, pinpointWidth, pinpo...

how to disable link in jquery

my page have a link <a href="/hyperlink">Hyper link</a> i want to open a dialog when user click on link. i want to disable link without remove href event or attribute from him means no changes in html then when user click on link then open a dialog if jquery not load or have a error cause open a link directly. how i can do th...

Update data into mysql database by clicking on a link

I there a way to update data into mysql database when click on a link? I want create a comment voting system on my site so when user clicks on a "Vote for this comment" link, +1 should be sent into database... How is that possible? ...

Jquery autocomplete JSON return result from webservice but it is not showing in dropdownlist

I do not know what is wrong with this code. alert shows that data has returned from web service but auto-complete still not showing data. I am using ASP.net 2.0 and google jquery link $(document).ready(function() { $.ajax({ type: "POST", url: "http://localhost/WebService/Service.asmx/getlist2...

How do i find the pixel value of the bottom of an element (div)

how can i find the pixel value of the bottom of an element. eg. the #posts div. i want to create a infinite scroller. and this is so that i can detect if the user has reached near/at the bottom of the #posts and i want to load new posts if so. update: i guess 1 option is to use $("#header").height() + $("#posts").height() but i ...

Fast dynamic JavaScript WYSIWYG editor

Right now I am using the TinyMCE wysiwyg editor within my projects. However there are some disadvantages with tinyMCE: Tons of GET requests Big It is slow. I can't have a large number of TinyMCE editors at the same time. (Especially in IE) Changing the DOM position of the TinyMCE caused issues where the listeners got lost. Complicate...

Is it possible to pass parameters in the HTML class attribute?

I want to be able to embed certain information into HTML elements (images) without breaking valid HTML markup. Would the following be valid HTML? <img src="..." class="isearcher:tags(paris+hilton,gary+suneese)" > The hope is to latter extract it with a regex in javascript/jQuery. ...

Does a jQuery.get() request act any differently from a normal web request?

i was just wondering if a jQuery.get() request have any difference to a normal web request. the reason why i am asking this is: i am doing a infinite scroller for my tumblr. it works well except that if there is a photoset, the returned HTML won't contain the JS/Embeds for the photoset and instead returns a raw version <p>s and <img> onl...

jQuery $.position() on Safari & Chrome

Hello there, I have an issue using $.position to retrieve the relative x/y offset on an element. It was mentioned before that both Safari and Chrome differ in handling it as the others. I'm using Raphael-JS. To cut the long story short, what I have is an SVG element wrapped by the parent, centered DIV wrapper: <div> <svg> ...

+1234567 ends up being 1234567... where is the plus?

Hi guys, Well through jquery i am doing an ajax request to send through a cell number in the format of +1234567 but if i access it on the other end using $_POST['cell']; the plus is gone, where could it be? ...

Use jQuery to match current URL to herf in a UL and add class if matched

I have a dynamically created UL. I want to use jQuery to use the current URL, search through a specified UL and find any li with a matching href. If one is found then add the class "current_page". I came up with this but it doesn't seem to do the trick. $(document).ready(function() { $("ul.nav_cat_archiveli").find("a[href='"+wind...

Loading values into an HTML select using jQuery/Json

I am trying to load values into a select dynamically using values from a json string. The data is being loaded correctly, but for some reason, only the 1st value is loading into the select. Can anyone spot why this could be? Here is my JSON data: [{"cat_id":"1","cat_section":"pages","cat_type":"cat","cat_name":"Music","cat_order":"1",...

a better way to check if a checkbox is defined?

hi there, currently i am using var email, fax, sms = false; if($('#uemail:checked').val() != undefined) email = true; if($('#ufax:checked').val() != undefined) fax = true; if($('#usms:checked').val() != undefined) sms = true; but its such a long way to write it. is there a better wa...

Why ":last" and ":last-child" does not work ?

I'm trying to select the last div with class my_class inside div with id a. I tried several options with :last and :last-child but none of them worked. Here is on try. What am I doing wrong ? ...

how to prevent form from sending some fields we don't want to send?

hi, i have form that have about 5 fields which final query created by processing values that fields. i want to send only final query not all fields to server. can i exclude some fields from submitting (with jquery)? <form action="abc/def.aspx" method="get"> <input type="text" name="field1" /> <input type="text" name="field2" /> ...