jquery

jQuery: addClass for each .next() element of a list

Im trying to use jQuery to add a different class for each Span element, using .next() This is the javascript: <script type="text/javascript"> $(function() { $("a", "div.top_menu").addClass("ui-icons-custom"); $("span.ui-icon:first", "ul.top_menu_list").addClass("ui-icon-pencil") .next().addClass("ui-ico...

Why isn't my jQuery recognizing the return from my CFC?

I have a page that uses a .post to submit to my cfc. I know the function works fine because the database is being updated but the alert that's being fired is the one in the 'else' statement. Can any of you see why my return isn't firing the correct alert? Am I not capturing the return properly? Some of my variables are hard coded for t...

Counting tags inside a iframe using jquery

iframe src is like this:-<iframe src="http://mysite.com/testing.php?id=7632762"&gt;&lt;/iframe&gt; and the content is dynamic.How to find out number of <div> or <li> or <p> tags inside a iframe by using javascript on server side or client side ? -Thank you ...

Console.log messages not showing up in Chrome's javascript console?

I am logging using the jQuery.log plugin (which logs to console.log if available) and I am not seeing any of the logging messages appear in the Chrome JavaScript console. Logging works on Firebug's console under Firefox, but I did have to explicitly enable the Firebug JavaScript console. Have a missed some option somewhere under Chrome...

need help with nested jquery function

Hi Please find my code below. My problem is that I the inner jQuery.get() doesn't get executed. Could some one help me out with this? jQuery(document).ready(function() { $('.error').hide(); $(".button").click(function() { // validate and process form here $('.error').hide(); var zipCode = $("input#name").va...

Whats the best approach to making a web application for drawing on and modifying an image?

Whats the best approach to making a web application for drawing on and modifying an image? Should be able to draw on, add text etc. I have been hearing a lot about SVG, but is that a required download for the user to view the application then? Whats the best way to handle this? What language? etc. Thanks! Preferred: PHP jQuery java...

ASP.NET MVC - Routing still confusing for me.

Hi everyone. I'm having difficulty with the concept of Routing within the ASP.NET MVC Framework. For example, I have a controller method: public class UploadController : Controller { public ActionResult Index() { return View(); } [AcceptVerbs(HttpVerbs.Get)] public ActionResult GetChildFolders(string id) {...

How to have scrollbars show up in jquery u.i 1.8 dialog?

Hi I want to a vertical scroll bar show up if the height of the dialog goes over so many pixels. However I have Height set to auto and it seems to keep growing and never makes a scroll bar. If I set the Height to 400px then once it hits this a scroll bar is made. However I want to keep height as auto. I thought MaxHeight might do the...

Changing a page from DropDownList using jQuery

Hello SO: I have a simple jQuery script that selects the current page from a static dropdownlist, and when the selection changes the script also modifies the href attribute of an anchor tag to reflect the navigation change. Here is my code: <select name="PageSelectDropDown" id="PageSelectDropDown"> <option value="Insulation">Insul...

JSON response from jQuery get raises "Invalid label"

$.ajax({ beforeSend: function(xhr) { xhr.setRequestHeader('Authorization', "Basic YWRtaW46YWRtaW4="); }, url: "https://test.com/incident.do?JSON&amp;callback=?&amp;sysparm_action=getRecords", dataType: "json", contentType: "application/json", method: 'GET', success: function(a,b,c) { alert(a); ...

Loop through All Objects of a Class

Let's say I have some class called loopObject and I initialize every object through something like var apple = new loopObject(); Is there anyway to loop through all objects of a class so that some function can be performed with each object as a parameter? If there isn't a direct method, is there a way to place each new object into an a...

Generating a jQuery UI progress bar

I'm using a 3rd party service to process images and they provide a handy jQuery plugin. The plugin can output feedback on the upload transfer, and I would like to display this as a nice jQuery progress bar from the jQuery UI. Here is the example they give, which currently just shows the transfer status as text: $('#MyForm').transloadit...

Highlight search terms (select only leaf nodes)

I would like to highlight search terms on a page, but not mess with any HTML tags. I was thinking of something like: $('.searchResult *').each(function() { $(this.html($(this).html().replace(new RegExp('(term)', 'gi'), '<span class="highlight">$1</span>')); )}; However, $('.searchResult *').each matches all elements, not just lea...

jQuery Masonary

I have the following page: http://driz.co.uk/masonary/index.html I have created a section on the right hand side for my portfolio work which is a bunch of LIs that are floated next to each other. I'm wanting to use jQuery Masonary with them as they will have different heights when the site goes live. Here is the same page with masonary...

Click event for multiline textbox

This is for a multiline textbox on an asp.net site. I can use either a html control or a an asp.net control but what I want to do is somehow recognize which line is being clicked - preferably server-side so that it works without javascript but a jquery solution would be fine as well. After the line is clicked I need to take the text from...

jQuery.ajax / CodeIgniter (PHP) : Returning TRUE/FALSE in PHP, how can I get jQuery to see this?

I've built a function for checking a username. I'm using it as a callback for form validation in CodeIgniter, and it works nicely. However, I'd like to also use it with AJAX to check on the fly if the user has JS enabled. So my controller has this: function check_username($s = FALSE) { if ($s): $this->db_common->like('userna...

Textarea newline prevention on Enter (jQuery)

I have: $('#myTextArea').keyup(function(e) { if(e.keyCode == 13) { e.preventDefault(); // Makes no difference $(this).parent().submit(); // Submit form it belongs to } }); How do I prevent the newline that shows up right before form submission? preventDefault() and stopPropagation don't work. I could manually rese...

Convert plain text into <input type="text">

Hello, I have multiple readonly textboxes like this <div id="box"> <form method="post" action=""> <input type="text" readonly="readonly" name="1" value="A" border="0" /> <input type="text" readonly="readonly" name="2" value="B" border="0" /> <input type="text" readonly="readonly" name="3" value="C" border="0" /> <input type="tex...

Can I shrink this jquery script down?

Hello, I was wondering if someone can help me shrink this jquery script down a bit? Right now, I have the ID on hover, but that can be changed to a class if need be. I'm sure there must be some way of doing it with "this" instead of having to list each and every one down. Below is an example with 2 of 11 different functions. I'm hopin...

Updating multiple elements from one selector?

Hello, I would like to update multiple elements(with different values) from the same selector. What would be the easiest way to go about doing this? I have tried $(document).ready(function(){ var t=$('.test input'); t[0].val('Foo'); t[1].val('Bar'); }); with this HTML <div class="test"> <input type="text"> <input type=...