JQuery :: Clarification On $(window) Vs. $(document).ready - Hiding All Of A Page's Content Immediately
Oct 18, 2010
I'm working on hiding all of a page's content immediately via Javascript. I want to avoid using CSS to display none just incase I run into users who don't have JS enabled.
I wanted to get advice from others and see what the difference is between using jQuery actions within $(window) or $(document).ready. From what I understand, $(window).bind("load, function(){ etc. will only use the script once all contents on the page are loaded, including images?
And $(document).ready(function(), etc just requires the DOM to be ready but will still execute code even if images, etc. aren't loaded.
Basically, I have an element I want to hide before it is shown when a condition is met. For reference, it's checking whether a particular radio button is selected. if ($('[name="'+q1110.name+'"][value="'+q1110.value+'"]:not([checked])')) $('#_divhide').hide(1, function () { q1110.toggle = false; }); Right now, only in IE 6, it shows that element for a split second, then hides it. I don't want it shown at all unless the radio button is checked. As usual, I can't manipulate anything in HTML unless it's done through JS.
Also, the slideUp and slideDown functions don't work properly in IE 6. They do hide and show, but the animation isn't smooth. The element disappears and reappears without any animated effects. It's kind of a bummer since it works perfectly in FF 3.6.
This question may be simple, but I don't know how to do it. (I'm getting hava script error) I have 04 master pages and around 100s of ASPX pages. So when I want to work in some conent page where should I use my $(document).ready(function(). I already have used this in Master pages. [code]...
I have noticed on a few occasions where I navigate to a page and the document.ready() function gets called and executes. I then push a button on that page which calls a javascript function that does a jquery submit to the same page I am currently on. This time, document.ready() does not get triggered. How do I make this happen the second time, have the stuff I want on page ready be executed? I am using Chrome if that helps.
I have an html page with a lot of JavaScript functions that all work fine. Then I decided to add a jQuery function, but the document ready is not executing when the page loads. As you can see below I've added the document.ready function at the top of the page, below the links. And below that are the JavaScript functions that were there all along. Why the document ready function doesn't execute? (I don't see the "ready" alert, and the jQuery isn't working.)
I am experiencing unexpected behavior using $(document).ready() on a page where I inject jQuery after the page has loaded and then attach listeners to the ready event. The ready() event is never called using Firefox and Safari however it is called using IE. Is this a jQuery bug? Is it working as designed?
I am sure this question has been raised and answered before, but I can't seem to find an answer that works for me. I hope I will get an exact response here. Here's my issue - I have my index.html that has its own $(document).ready method and everything pretty much works within it. I am trying to dynamically load a page to replace part of index.html (let' say the #inner_content ID) -
<!DOCTYPE html> <html> <head> <title>JQuery test 1</title>
[Code].....
When I open page2.html, and click on the brnClick link, it changes the content of divclick. If I open page1.html, and then navigate to page2.html, click on the link does not work.
This is a clarification of a previous message, which was not expressed very well. I have a set of checkboxes near the bottom of the page and a function that checks or unchecks all of them. But when the function runs, the window scrolls to the top of the page.
How can I set my checkboxes but leave the window's scroll position exactly where it is? Or at least have it scroll to the bottom (where the checkboxes are).
I've tried using window.scrollTo(), but the window always scrolls to the top no matter what. It's the same in Navigator and IE.
i've hit a brick wall with this one and hoping someone can help. I'm using a simple tabs script (a customised version of one that jimmyP and pmw57 came up with on this forum) and IE7 is giving me the dreaded flicker on page load where you can temporarily see the content of all the tabs, before the JS is executed and only one of the tabs is displayed. I think i'm not noticing it in FF and Safari simply because they're executed the page too quickly for me to notice.
The page can be seen here I thought I would be able to set .tabs to display:none in my main css file, then in the JS, simply use show() and hide() as necessary, but doing this hides everything for some reason, without restoring the desired tabs. I'm using jScrollpane in conjunction with my tabs script, so there may be a conflict there as there are so many divs being created dynamically.
I am writing a script that opens a popup, tries to access the document object in order to access the body object, and then find a DOM element in the child window.Seems simple enough, except that the window opens, and the document and body objects are NOT what they should be.The code for opening the child window (popup) is:
Code: childWin = open("http://localhost/childDocument.html", ...); childWinDocObj = childWin.document; Here are just some of the properties of childWin.document relevant to this discussion:[code].....
And THAT is just how it is supposed to look.Which means that, by putting on the brakes of the execution of the script, the open() function works as expected: it opens the window and is supposed to load the document content specified by the URL in the first parameter!But not really: when the brakes are NOT put on the action of open() , it opens the window, and then delivers document and body objects that are NOT the content of the URL.
I'm new to jquery. I did some pages in jquery.I'm confuse about the use of $(document).ready. Whether I put my code inside or out of $(document).ready, it works fine. In plain english, how can we describe the use of $(document).ready?
I am trying to use the Multi Drop Down Menu plugin available at CodeNothing.com. However the problem is occuring even without calling the functions in the plugin. (It occurs when I call the functions in the plugin as well but that doesn't matter)I am experiencing some very strange behaviour. I havesome standard nested unordered lists where the top list is given the id multi-ddm. Now when I run the code below I get 1 alert (which is correct as I only have 1 child li element) saying hello.
no error appears and the alert appears once, which is correct.So is it the $(document).ready that is causing the problem or the '> li'. I cannot work it out and have been at it chopping and changing for ages.
I know that to run jQuery when the document is ready, you just use $(function() { ...jquery code... });
but that isn't allways what I want, sometimes I want to one or more jQuery codes when for a example a div (with a class or id) has been created, or when an image has loaded.
i have two pages A & B A shows the intended functionality of the fading images/text on the left, the video image that pops up a jquery tools expose overlay, and the tabs on the bottom left page B is identical in all ways that i think matter. in other words, the javascript and html elements are all the same. the only other difference is that page B is created via a wordpress theme.
There are pages containing input field where in user enters value. Now I have a requirement to block UI untill the document is ready and every input field is rendered. I have found that I can use blockUI plugin for this : [URL] I have also found few good examples in : [URL]
how do I call $.blockUI() on pre-ready stage and call $.unblockUI(); on .ready(). I would want my UI to be locked untill the doc is ready. I can put call to $.unblockUI(); in .ready() but where do I put $.blockUI().
I use the document.ready function by jquery to trigger some action in an asp page. the problem is that IE has problems the first time the page is loaded. I register the window.resize event for example to do the same actions i do once after first load to keep some alignments correct. these will work in ie but not the initial alignings. I played around with the position of the javascript already and tried everything from having it in the header as well as putting as last element right before </body>.
I am needing to use both functions, as shown below, which are within the <head> section of my code. However, I find that if I do both, neither works. If I do only one, it works.Apparently, I don't know how to properly use $(document).ready(function(). What should I do?
All the examples ive found only explain using it in the context of direct functions. I cant make this external either because its referencing an id, at least i tried it and it didnt work. [code]