Skip to content
Advertisement

Tag: jquery

Javascript find if english alphabets only

Am trying to find some text only if it contains english letters and numbers using Javascript/jQuery. Am wondering what is the most efficient way to do this? Since there could be thousands of words, it should be as fast as possible and I don’t want to use regex. Thank you for your time. Answer A regular expression for this might

jQuery’s offset() function

I know jQuery does most when it comes to cross-browser issues. I just wanted to know if offset() method of jQuery serves the purpose of cross-browser compatibility, I mean top, left, etc properties that can be derived from it? Basically once I apply top, left, etc properties (which are derived from offset() function) to an element, I need to make

jQuery vs. javascript? [closed]

Closed. This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 9 years ago. Improve this question I recently stumbled upon some javascript forums (sadly, link is lost somewhere in the universe), where you could feel real hate

What is the non-jQuery equivalent of ‘$(document).ready()’?

What is the non-jQuery equivalent of $(document).ready()? Answer This does not answer the question nor does it show any non-jQuery code. See @ sospedra’s answer below. The nice thing about $(document).ready() is that it fires before window.onload. The load function waits until everything is loaded, including external assets and images. $(document).ready, however, fires when the DOM tree is complete and

When loading an html page via ajax, will script tags be loaded?

When you load an html document using AJAX, what does it do with the nodes inside the HEAD tag: (script,link,style,meta,title) ignore them or load and parse them? And in the case of jquery ‘s ajax() function? Answer When you call the jQuery.ajax() method, you can specify the dataType property, which describes what kind of data you are expecting from the

Best way to add DOM elements with jQuery

So I’ve seen three ways to add html/DOM elements to a page. I’m curious what the pros and cons are for each of them. 1 – Traditional JavaScript I believe the straight JS way to do it is by constructing each element, setting attributes, and then appending them. Example: 2 – Appending a string of html via jQuery I’ve noticed

Non-AJAX jQuery POST request

I am trying to use the jQuery POST function but it is handling the request in AJAX style. I mean it’s not actually going to the page I am telling it to go. This function should go to comments.php page with the aid value in hand. It’s posting fine but not redirecting to comments.php. @Doug Neiner Clarification: I have 15

How to get the number of lines in a textarea?

What I would like is to count the number of lines in a textarea, e.g: should count up to 4 lines. Basically pressing enter once would transfer you to the next line The following code isn’t working: It always gives ‘1’ no matter how many lines. Answer I have implemented the lines and lineCount methods as String prototypes: Apparently the

Advertisement