Trying to prevent browser bog/freezing while parsing a giant string (Seeking strategies to do this more efficiently)
I'm trying to make a js solution that takes a large (3MB test file, 10-20MB max in real use) text file from a server and does some processing on that file to accelerate my work flow. The current issue I'm trying to solve is that the browser is freezing when I try to parse the file after it has loaded since it is thousands of lines long. (plain text) I don't have a problem with the browser taking a while to process the parsing, I just don't want it to freeze 'solid' while it's processing. I've got
Text Change On Event
Hey guys, I'm putting together a site for a pal's band. I've got a sliding div that slides up when a link (with text) is clicked and back down when the link is clicked using: $(function() { $('#bottom-blog-button a').click(function(e) { $('#home-content').slideToggle(); }); }); and some corresponding CSS. What I'd like to do is make the link that triggers the event to change text whenever the div is visible and change back when it returns to hidden (like "show div" / "hide div"). Can anyone
Wrap groups of elements depending on variable criteria
So let's say I have a list of 11 elements and I want to wrap groups of them by 2. I have this: <div class="wrapper"> <div>Some Stuff</div> <div>Some Stuff</div> <div>Some Stuff</div> <div>Some Stuff</div> <div>Some Stuff</div> <div>Some Stuff</div> <div>Some Stuff</div> <div>Some Stuff</div> <div>Some Stuff</div> <div>Some Stuff</div> <div>Some Stuff</div> </div> I want this: <div class="wrapper"> <div class="subWrapper">
Clearbox, fancyBox causes lost of other functions?
When I try to implement a third-party modals/boxes/dialog (clearbox, fancyBox, etc.), I loose the use of all other functions after one of these has been called - like swipes, return, etc. I am using the mobile vs. Any ideas to why this may be? I am just learning jQuery so it may be something on my part so any enlightening to what to look for would be very helpful. Thnx!
need help: photo galley main pic fade in
Hi, I'm starting on jQuery. I'm just trying to make a simple fadeIn on a php gallery, but i still can't do any good fade(in/out) on the viewer, Here are the files: PHP <?php $output = ''; //$typesArray = (1=>"gif", 2=>"jpeg", 3=>"png", 4=>"swf"); $img = array(); $i = 0; foreach(new DirectoryIterator('images') as $fileinfo) { if($fileinfo->isDir() || $fileinfo->isDot()) continue; $pathname = $fileinfo->getPathname(); $type = exif_imagetype($pathname);
multiple selectors in .hover api
Hi im currently creating a dropdown menu with an animation to it, my current jquery script is as follows $(document).ready(function () { $("ul.menu_body li:even").addClass("alt"); $('ul.menu_body, img.menu_head').hover(function () { $('ul.menu_body').slideToggle('medium');}, function () { $('ul.menu_body').slideToggle('medium'); }); $('ul.menu_body li a').mouseover(function () { $(this).animate({ fontSize: "14px", paddingLeft: "20px" }, 50 ); }); $('ul.menu_body li a').mouseout(function
Issue with ajax handlers not being called
I've got an ajax prefilter which defines a success, an error, and a complete function callback onto the jXHR object. During a successful ajax response I first his the success function callback (as expected), and if I throw an error from within this callback I hit the error callback (again, as expected). However, at this point I would assume my complete callback would be called, yet it never is. Is this by design or does it sound like a bug? I ran a sanity test by issuing an ajax request to an undefined
How to Reference Form Elements
I need to know how to reference a specific form element within a page with multiple forms and common element names, example below. <form id="Form1"> <input id="UserID"> </form> <form id="Form2"> <input id="UserID"> </form> <form id="Form3"> <input id="UserID"> </form> I thought something like this would work, but I can't get it to work. $("#Form2.UserID").change(); Any help would be appreciated.
Auto play is not working in Slider...help...?
This slider is working fine when actively using/clicking/hovering but will not autoplay. Any ideas? Code Below: CSS /*image slider*/ .rotator { position:absolute; background-color:#FFF; top: 165px; left:0px; margin:0px; padding:0px; z-index:2; width:1002px; height: 280px; border:none; } /*--Main Container--*/ .main_view { float: left; position: relative; height: 280px; } /*--Window/Masking Styles--*/ .window { height:280px; width: 1002px; overflow: hidden; /*--Hides anything outside of the set width/height--*/
Jquery & Getting CSS
So this issue is new to me. And pretty familiar with Jquery. Just curious why this works: $("div#footer a").css('color'); But these do not: $("div#content a").css('color'); $("div#side1 a").css('color'); $("div#side2 a").css('color'); CSS: div#content { background-color: #FFFFFF; color: #000000; margin: 0 200px 0 25%; } div#content p { line-height:1.4; } div#content a { color: #3ece26; } div#content a:hover { text-decoration: none; } div#side1 { background-color:#B9CAFF;
Assigning DOM elements to variables at the begining?
I'm developing a web app and need to reduce redundancy as much as possible. Would assigning elements using: var elem = $('#id'); at the beginning help? Then I could just call elements using "elem.method" instead of having jQuery recurse through all the elements every time. I don't know much about how jQuery works underneath.
Object doesn't support this property or method
New to the forums here - would appreciate some help if y'all have a min. Any ideas why we would be seeing a distinctly inconsistent error in the following code block? I've had several reports of IE8 throwing a "Object doesn't support this property or method" error on line 3 below, though I've been unable to recreate the problem in some tests I've done in any IE mode (7,8,8c). (percent is reliably defined above) var link = "<a onclick='timerHow();'>How does our timer work?</a>"; var newHTML = percent
how to export excel through ajax call
hi i am using .ajax() for making asyncronous call, in my case the resonse content type is "application/x-msexcel", in jsp setted content type. ajax call look like this: $.ajax({ url : "url.do?button=default", cache: false, success : function (data) { $("#divId").html(data); }, error : function (jqXHR, textStatus, errorThrown) { alert( textStatus ); alert( errorThrown ); } }); Can any one tell how to get a dialog box which asks for save/open/cancel...? thanks in advance
data listing related div/table refresh problem
i have this code $.ajax({ type: "POST", url: "<?=base_url()?>users/register", data: $("#register_form").serialize(), success: function(html){ $( "#users tbody" ).after(html); }, error: function(){ alert('Error'); } }); this
.css does not update in firefox? works in chrome and safari
Here is a small demo of a iphone like checkbox I want to use in some forms. the problem is the .css({'background-position-y':'0px'}) or .css('background-position-y', '0px'); won't work in firefox? <html> <head> <style type="text/css"> ul.check-box li{ list-style:none inside none; v-align: center; } li.on-off{ background: url("http://static.blacknight.ie/gibo/images/checkbox_on_off.png") no-repeat scroll
post with jquery 1.5.1 and IE6
Hello, I got a problem with the jquery post method. I have these two scripts: The main site <?php echo "<div style='border:solid 1px black;' id='in'>test</div>"; echo "<div style='border:solid 1px black; background-color:red' id='out'></div>"; ?> <script type="text/javascript" src="../intern/jquery/jquery-1.5.1.js"></script> <script type="text/javascript"> $("#in").click(function(){ $("#out").html("lade..."); $.post("post.php", function(data){ $("#out").html($(data).find("text").text()); }, "xml");
Internal Server Error 500 thrown from perl script ...
I have a perl script which is called via Ajax. It simply writes 3 values to a database. The code works fine (values get written successfully) but I get an "Internal Server Error" thrown. The Errorlog says "premature end of script headers". There was no problem with the application - it works as required and has for a few months - but I noticed the error via Firebug when testing something else. So I started stripping perl out of the script in an attempt to locate the problem .. and continued till
JQuery in Web Project
Hi, i am creating a dynamic web project using spring MVC. In the usual hierarchy, ie, "WebContent/WEB-INF/views" folder contains the jsp/html pages. So i tried to put all files of the jQuery (js,css,jsp) in the view folder itself. It is finding the javascript files, but it is not finding the images in the image folder. the path given in the css file is "images/imagename.jgp" Please look into the matter and let me know asap! Thank you! Utkarsha
Source Code from Iframe (same domain)
Hi I would like to view the source code from an iframe using Jquery (same domains) in an alert and also place it inside a text area. I am currently using the following code: <script> alert($('#myIframe').contents().find('html').html()); document.searchform.txtarea.value=$('#myIframe').contents().find('html').html(); </script> The code works perfectly for Internet Explorer but does not work for Chrome. Also it only works on my local computer but doesnt actually work at all for IE or chrome when
Effects with 2 divs and after one only function
My problem is simply. I have 2 divs with class="a" and take them: var div_elements = $("div.a"); Then I start an effect: div_elements.fadeOut(300, function() { alert(1); }); OK. But I only want to make 1 alert, not 2. How can I make only a one function after than execute a 2 divs with a 2 effects??? Thank's a lot!
hi
hi am jenny new here nice place for sharing Jennifer Parker
jquery 1.5 and IE 9 RC, won't work
When trying to use jquery 1.5 with IE 9 RC I get an error saying that at line 5460, character 4, propery or method getElementsByTagName is not supported. Is this a jquery bug or an IE one?
Execute JS script when calling another file using AJAX call
Hello, I'm encountering a small problem. I have an plain HTML file (it's for testing) where I have a link, when clicking on the link a $.load function is execuded to load another HTML file, this is working. BUT in that other HTML file I have another Javascript (add this share button),but one is working because it's not being parsed through DOM. Tried to put the javascript in the first file, but this doesn't work either. My best guess is to bind the javascript, no? Anyone can help me out in this situation?
Opening a TCP connection using jQuery....
Is it possible to establish a TCP/IP connection using jQuery?
Changing URL after ajax event.
So I have a navigation I am working on that could be adaptable to any site. You click on a link and new content arrives with fade in / out. Pretty standard. However, I would like the URL to change so it can be copy/pasted and/or bookmarked. The code below works, but the fades don't work. Also, I know this 'breaks the back button' and I plan to tackle that next. $(document).ready(function() { $("#nav a").click( function ( event ) { event.preventDefault(); if ( !$(this).is(".current") ) { var url =
Problem finding selected radio button in Internet Explorer with function/onchange - wrong value obtained
Hi all, The following code works fine in FF and Chrome for getting a radio selections value but not IE8. $('input[name="search[gender]"]').change(function() { var check = $('input[name="search[gender]"]:checked').val(); Inputs are below: <input type="radio" name="search[gender]" value="1" class="v_middle" />Male <input type="radio" name="search[gender]" value="2" class="v_middle" />Female <input type="radio" name="search[gender]" value="3" class="v_middle" />Couple <input type="radio"
How to get this working reliably?
hi there In my forms, i use a "beautifier', a background changer following the cursor. I do this like this: fld = $("#some_form :input"); fld.bind('focus', function () { $(this).data ("background", $(this).css("background-color")); $(this).css("background-color", "#ffcc00") } ); fld.bind('blur', function () { $(this).css("background-color", $(this).data ("background")) } ); Simple and working ... EXCEPT: If a field already has an onblur handler which for intrance uses alert(), the above no longer
Modal Form
Hi I have the following doubt: In the Modal Form, what can I do to personalize the text of the warnings that appear when some imput is empty or the number of characters is incorrect ? Thank you
Change event handler and IE8 - not working
Hi there, I have a simple little function that calculates a price quote based on the options chosen in 4 different drop down lists (Select elements) and 2 sets of Radio buttons. The total price is written into a div and is updated each time site visitor changes the value of Select or Radio button elements. I use Change event handler to fire the calculation function. It works perfect in Firefox, Chrome, Safari, but the calculating function doesn't get triggered in IE8. Here is my web page with this
ajaxed div will slideDown to the wrong height
If anyone could help point me in the right direction, it would be much appreciated. I've learned a lot in the last few days struggling with this. I have a site that is a grid made out of li elements that are a fixed width and height and all float:left. Some have hrefs and are ajax links. The site finds the li elements that are on the left and adds a special class. It then moves a content container (#wrapper) infront of the nearest one of those. And then loads content. When I animate the open and
trying to do a specific toggeling with Jquery
my code what i need is when i click the "next" button, that the current "box_content" will slide up and the next one inline will slidedown. please help. thanks.
Function pointers causing an odd error.
JQuery Version jQuery JavaScript Library v1.4.4 Problem The solution may be blatantly obvious, however I'm scratching my head. The problem is while doing some code optimisation I came across a loop that called append on a jquery element a few times and it was a rather large loop. So it looked something like this: var list_of_goodies = [1,2,3,...]; $.each(list_of_goodies, function(val) { $('div.toaddto').append(val); ...some more code... $('div.toaddto').append(otherval); }); As
Css value problem
hey friend i am using the latest jquery and jquery ui version my problem is that when i change the e.g a box on screen like drag it to a new position or resize it it happens but when i refresh the page it is back to its normal position ........... what i want to do is retain the new position and save it to my css file and also 1. i want to add a div tag using jquery (which i can do) e.g <div id="box"></div> 2. then i want to add/append a css rule in my css file e.g #box{ } using jquery or php
Checked radio element creation
Can anyone tell me why jQuery isn't checking radios built with element creation? var radio = $("<input />", { type: 'radio' }).attr('checked', true); // or .attr('checked', 'checked'); This produces <input type="radio" /> All other attributes work fine, just not checked... Am I going mad or is this a bug? (Tried with 1.4.x & 1.5.0)
How to 'refresh' the code source the jQuery will detect again?
Hey there, I've been using jQuery for a couple years now and I just ran into a problem. I've had this problem before but I forgot how I resolved the problem and I can't find it anywhere anymore either. Here is the problem: I have a simple html form with some <select>'s. Once one is hit, jquery will use $.post to get new content from a php file and update the contents in a div with new form items (new <select>'s). Now I want to be able to use these selects with ajax too, however, the .change function
jQuery UI Slide - no complete hide?!?
Hi everybody, I'm very new to jQuery and now playing around a little to learn for a new project. Is it somehow possible to set the UI slide effect so that it doesn't fully hide away? e.g. my div is width:300px I have set the distance:220px. So it doesn't completely slide in... but still the left 80px hide away after the slide. How can I set it that this stays visible?? Or is there a workaround for this?? Appreciate every help!! Thanks in advance!
using .after()
I am using after function to add some html code after the specified id but how can i.delete the html code afterwards? I am trying to make a toggle in jquery using this technique .after() but is there a removeafter()? Thanks
Why can't I add classes to spans containing checkboxes?
I have in my code: jQuery("span[class='checkbox']").addClass("unchecked"); jQuery("span[class='checkbox'] input:checked").parent().removeClass("unchecked"); jQuery("span[class='checkbox'] input:checked").parent().addClass("checked"); The intended effect is for spans of class "checkbox", which should each contain one checkbox, to have the class "checked" if the checkbox is checked, "unchecked" if not. When I load the page and do an "inspect element",
move jQuery to new namespace
jQuery.noConflict lets you change the jquery namespace after it has been loaded but I think I need a way to do this before it is loaded. Here is my use case. I have a widget It can be placed on any site Those sites may be running jquery, prototype or other libraries. To avoid conflicts we wrote our own library but rather than maintain that it would be nice to leverage JQuery since we all know and love it. One thought is to save a copy of jquery.js, rename the namespace, remove $ alias and then
If-statement dosnt work
Hello, What I want to do: If I hover over a tab (there are 3) all other tabs will close.Below is the code for the first tab if($("#box1").mouseover) {(function () { $("#box1").animate({ width: "500px" }, 400 ) $("#underbox1").delay(350).slideDown("slow").css("width","500px") $("#underbox2").slideUp("slow") $("#box2").delay(550).animate({ width: "200px" }, 400 ) $("#underbox3").slideUp("slow"); $("#box3").delay(550).animate({ width: "200px" }, 400 ); });} What is the mistake
Next Page