If a page has both JQuery and Prototype then I got conflict. There is a option to disable $ sign for JQuery so there is no conflict but, I have to use keyword JQuery instead of $.
I wonder if there is any option for Prototype to solve this conflict. Is there any way to use both libraries without compromising their benefit or short keywo...
How could I, on the fly, remove spaces entered into a textbox while the person is typing?
...
This should work right? I have not a clue as to why it's not. I have to be doing something wrong.
<div id="randomdiv">text</div>
<a id="refresh">click</a>
<script>
$(function() {
$("#refresh").click(function() {
$("#randomdiv").load("index.php")
})
})
</script>
...
I'm trying to overlay a element on top of a webpage (to draw arbitrary graphics), and I've come to the point where I can stack it inside of a element on top of everything, but this prevents the user from clicking on any links/buttons/etc.
Is there a way to have its content float on top of everything (it's semi-transparent, so you can s...
I have some javascript code that creates an img tag with a mouseover callback, and adds the img tag to the page. The problem is that a javascript syntax error happens (in the Firefox Console) whenever the callback is invoked.
This code demonstrates the problem...
var imgUrl = 'http://sstatic.net/so/img/logo.png';
var ...
Inspired by this answer.. Can you guys point me to something similar--something that can be integrated into a build-script or perhaps directly into Visual Studio?
...
I am working on a ruby on rails application. All the controllers have one javascript file. However there is a functionality ( call it business.js) which is needed by two controllers. Now just because two controllers need it , I don't want to put this logic in application.js which will make this logic available to all the controllers.
I ...
I'm using the onkeyup event on a form field in JavaScript, and I'm wanting to check if the key the key pressed is a numeric digit - ie. 0 - 9, so I can then do something with the input.
<input type="text" onkeyup="" />
Would I need to use Regex for this?
Thanks
...
I am looking for a good online reference to working with XML in Javascript. Specifically, I am using the protoype library. I have my ajax response with a valid responseXML document.
I can find all sorts of online examples for looking at the data in the first child node of the first element tagged 'X', but that doesn't help me. What I ...
Internally, Firefox will JSON encode an object passed via postMessage to and from the Web Worker. However, this only works in Trunk builds of Firefox (3.6+) and not in Firefox 3.5, so the question is really how to add backwards support of this operation to the current platform. The window.atob() and window.btoa() methods had been suggest...
Many of the web pages I am working on use files such as images and scripts that are mostly on a different domain from the page itself, so I put a base tag in the head of the page. For most purposes, this makes the site easier to work on. However, the page has a form, and I want to make the form submit to the same domain as the page. I wo...
I've been working on a Windows SideBar Gadget wherein I have multiple flyout pages. When I go to display one, I want to check if it is already active or not, so I thought I could just check the value of System.Gadget.Flyout.file. However, when I press the button control that causes this flyout to pop out, the background of the gadget dis...
Anyone have any clean patterns for getting php vars into the js scope?
Two ways I have done it before is either injecting it with an actual call from the base template inside a document ready wrapper.
(jQuery/Smarty Template)
{literal}
$(document).ready(function() {
TargetClass.targetVar = {/literal}{$phpVar}{literal};
});
{/liter...
I was wondering if there was a function that I can add to this, that would show the data again, as in make it slide back down or something after a given set of time so you can go back and re-enter your data.
It currently just slides up after submit, and then shows the text.
$("#help").slideUp(function() {
$("#help").before('<div class...
I want to save the contents of a multline textbox when off focus - i.e. user has finished typing and clicks outside the textbox so it goes off focus.
I can handle the saving- thats no problem, but is there an off focus function?
I don't mind a javascript version. I must be using asp:TextBox though.
I tried with onFocus, OnServerChange,...
I want to associate a javascript object with an HTML element. Is there a simple way to do this.
I noticed in the HTML DOM (http://www.w3.org/TR/REC-DOM-Level-1/level-one-core.html) defines a setAttribute method and it looks like this is defined for arbitrary attribute name. However this can only set string values. (You can of course use...
How do I go about binding a function to left and right arrow keys in Javascript and/or jQuery? I looked at the js-hotkey plugin for jQuery (wraps the built-in bind function to add an argument to recognize specific keys), but it doesn't seem to support arrow keys.
...
I'm having a problem using the jquery hover events. I've created a reduction of the problem. You can find a working demonstration here. I can reproduce this after moving the mouse around in IE, FF, Opera, and Chrome.
I'm using queued animations in my mouseover event. Roughly 1% of the time, the color of the td elements is left as #...
I'd like to write something like this (in Javascript):
var obj = { left: left, right: -(left += increment) };
This will only do what I want if I can be sure that attribute values will be evaluated in the same order that I write them. Does the language make such a guarantee anywhere?
...
Hi Guys,
I have this site I am developing: http://tinyurl.com/l7uzzp - I made the scroller with the following code:
$(document).ready(function()
{
function scrollIt()
{
$('#featured-brands div#scroll').animate({
marginLeft: "-4550px"}, 85000, "linear").animate({
marginTop: "-223px" }, 2...