I'm sending a $.post request to php with jQuery. The jQuery code looks like this:
$('form').submit(function() {
username = $('input[name="username"]').val();
alert(username);
$.post('/ajax/new_user.php', {username:username}, function(data) {
alert(data);
});
});
In PHP, I'm just trying to do this for now:
<...
I need to know how I can easily add another series to an existing plot using Flot. Here is how I currently plot a single series:
function sendQuery(){
var host_name = $('#hostNameInput').val();
var objectName = $('#objectNameSelect option:selected').text();
var instanceName = $('#instanceNameSelect option:selected').text();
var counterN...
flickr
Here's a simplified demo: http://jsbin.com/emugo3
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script>
try {
$(function () {
$.noop();
$("#hello").text("it works");
});
} catch (e) {
alert(e.message);
}
</script>
The user agent for my phone's browser is:
Nokia...
I am using the jQuery UI Tabs to display a number of forms (each tab can contain more than one form). When I switch between tabs, I am attempting to do POST of the tab's forms using AJAX calls. Here is the jQuery for what I am doing.
select: function (event, ui) {
var tab_index = $('#tabs').tabs('option', 'selected');
v...
Hi,
This questions is bit specific to joomla.
I have created the custom error page error.php in /template/MY_TEMPLATE/error.php. This file checks for the error codes and displays different message for each http code I set(I check with $this->error->code == '404'). Normally this works good.
Now the question is, how should I handle same ...
I've got an Autocomplete input that is a filter to a datatable. When the person searches in the box, autocomplete does it's job and attached to the source callback, it does an ajax lookup and triggers an update to the table. Additionally it updates a div mentioning how many suggested results were returned.
I've also got a "suggest" butt...
I am using the ThreeDots jQuery pulgin and it works great. I am having trouble using it on an ajax success event.
$.ajax({
type: "POST",
url: 'url',
success: function(value) {
$("#content").append(value);
$(".ellipsis").ThreeDots({max_rows:3});
}
});
I load some new data and append the new data to a di...
I am having a problem getting to the parent window.
I have a window that has 2 frames...one of the frame opens another window which in returns open a third window. In the third window I want to refresh the very first window by doing this
window.opener.window.opener.close();
it only works for non frame setup...what can I use for the fr...
I have a list of objects called projects that are sortable, and a list of objects called categories that are droppable. I need to somehow make it so that when you click on a sortable project, and drag it down so it is hovering over a droppable category, the category that the project is going to go into is highlighted, or outlined or some...
Hello,
I want to get the href, src, width, height of all images on a page. The jQuery code is
$('img:regex(data:extension, jpg)').each(function() {
var imgsrc = $(this).attr('href');
//$(this).attr('width') =0;
var newImg = new Image();
newImg.src = imgsrc;
var width = newImg.width;
//wid...
following is my HTML
HTML :
<div Attr1 = "val1" Attr2 = "val2" Attr3 = "val3" >
Hello !!
</div>
I want to extract all the attributes (& its corresponding values) of an element.
How can I do this using jQuery?
I tried something like below,
$(function() {
for(var i in $('div')[0].attributes) {
console.log($('div')[0]....
Hi everybody!
My problem was that I wanted to add JavaScript into a html page, thanks to Andy E, I find the way to add my JavaScript into a html page and be executed. But now my problem is that all the page is overwritten by the JavaScript. Someone know how to do the same thing but without overwritten the page with the JavaScript, somet...
I have a need for inter-component communication in a web application and am considering different ways to accomplish this. I have some ideas, but would welcome other ideas.
First, a quick and simple example. I have two separate components on a page that are loaded asynchronously. By component, I mean a chunk of HTML that has a javascrip...
Is there a way to reload the selected tab I know there is the .load() function. But it wants a tab index and I don't seem to see a way to grab the selected tabs id.
...
Hello,
I am using fancybox to open submitted form like this....
<form name="form" id="myForm" action="{$smarty.server.PHP_SELF}?action=abc" method="post" target="iframe" onsubmit="document.getElementById('iframe').src='{$smarty.server.PHP_SELF}?action=abc';">
<input type="hidden" name="xyz" value="123">
<input type="submit" value="...
I have a jQuery event handler that essentially looks like this:
$("textarea").live("focus, click", function() {
var o = $(this),
expand_height = "60px";
o.animate({height : expand_height});
}
As you can see, onfocus or onclick it is supposed to animate the expansion of the textarea from it's initial height (20px) to it's exp...
I'm trying to replace a string (Completed) with another string (C) that resides in a tablecell in some HTML being returned from a jquery POST. The POST is working correctly and I'm able to find my string, but setting it to the new string doesn't seem to do anything (no errors, but the original string is rendered in my page). Below is m...
I'm not sure what the best way to approach this is.
I have a control that I want to be able to open and persist some data or change it on the fly.
function TaskControl(params) {
this.params = params;
this.openTaskControl = function () {
alert("openTaskControl");
}
$("#button").click(function () {
this....
I was running some performance tests to see if i could use jQuery directly instead of Ext's wrapper. To start with i wanted to compare jQuery(#id) to doc.getElementById, but i must be doing something wrong, since jQuery(#id) is awful slower.
var searchDoc = searchWin.document;
var jqSearchDoc = jQuery(searchWin.document);
for (var i=0; ...
Hello all,
I have done extensive client-side validation through the help from jQuery. Now come to the server side validation, if I found some fields are not valid, can I simply return an error to client and without any useful message?
My assumption is that the user has to enable JavaScript in order to access my webpage. The user will n...