I use the following javascript (with jQuery) to handle drag and drop on a script I am writing:
jsc.ui.dragging = false;
jsc.ui.drag_element = {};
$(".drag-target").mousedown(function() {
jsc.ui.drag_element = $(this);
jsc.ui.dragging = true;
});
$("html").mousemove(function(e) {
if(jsc.ui.dragging) {
jsc.ui.drag_element.css({"posi...
I have a big content slideshow kinda page that I'm making that is starting to use a lot of event triggers. Also about half of them use the livequery plugin.
Will I see speed increases by unloading these events between slides so only the active slide has bound events?
Also is the native livequery significantly faster then the livequery...
How is this supposed to be written so that it would actually work?
saveBuyerInfo(
{ 'save_'+$("#textAreaXMLPostRequest").attr('name') :
$("#textAreaXMLPostRequest").val() } );
...
This is partially a request for a workaround, and partially an attempt to get the word out that Internet Explorer's prototype implementation is still faulty.
The following code does not work on Internet Explorer.
XMLHttpRequest.prototype.old = XMLHttpRequest.prototype.open;
var x = new XMLHttpRequest();
x.old("POST", "test", false);
...
I have a long string and I need to find instances of '#!#'+some text+'#!#'
right now I have:
string.replace(/(#!#*#!#)/g,
function (m) {....});
I need the whole thing passed into a function like that so that I can replace them correctly.
However, I want m to only be equal to what lies between the two #!#..I want this part....
Anyone know how can I disable backspace and delete key with Javascript in IE? This is my code below, but seems it's not work for IE but fine for Mozilla.
onkeydown="return isNumberKey(event,this)"
function isNumberKey(evt, obj)
{
var charCode = (evt.which) ? evt.which : evt.keyCode
if (charCode == 8 || charCode == 46) return f...
I am trying to create a bookmarklet that, upon clicking, would request some information from the user (a url and a couple other fields in this case) and then send that data to a php page on my server and then display the result.
I would like to do an Ajax call for this so that I don't actually redirect to the new page, just get the data...
Is there a jquery function to sort a table. I am aware of the JQuery Tablesorter plugin but I want to avoid using it if possible.
As a FYI - The table that I have a header with custom images to indicate ascending and descending. The data type could be pretty much any type.
EDIT:Can I do sorting of a table in Javascript?
...
I know how this will sound.
I couldn't help asking this question after looking at http://www.chromeexperiments.com/
Any ideas on possible implementation approaches?
...
I think I know the answer but... is there any way to prevent a global variable from being modified by later-executing <script>? I know global variables are bad in the first place, but when necessary, is there a way to make it "final" or "immutable"? Hacks / creative solutions are welcome. Thanks
...
If I do 0 == "0" it evaluates to true. Try,
if( -777 == "-777" ) alert("same");
alert happens.
And, it's also noticeable that true == "true" doesn't evaluate to true. Try,
if( false == "false" ) alert("same");
alert doesn't happen.
Why is it so?
...
Does anyone know why the Onkeydown() event does not work for delete and backspace key in IE? It works fine for number and character keys.
...
I have a json object 'items' which has few items that I want to show 2 of them every 2 seconds. How would I do that? so, it displays items in division1 every few seconds instead of showing all at once. Eg. get all items every 5 seconds and show 4 items every second for 20 items.
<table id="division1" >
<thead>
<th>Name</th>
...
I have written a small application for a handheld device using JavaScript and Google Maps API's, now II need to move my marker icon anywhere on the map along a route using a timer function. I have a man icon and I need to move it automatically on the map. How can I do this?
...
Hi friends,
I want to parse a web page into my page, so i prefer AJAX in my code.
While using the AJAX it showing "Access denied" - before fetching the specified page. The page doesn't consider any login information.
Even though i cant able to get the page of google too..
Please guide me to how to use the AJAX so for
Thanks,
Praveen
...
javascript:
(function ()
{
if (!map.me)
{
map.me = map.createLocationMarker(
"http://libgmail.sourceforge.net/man.png", N.get("local"));
};
mv = function(i)
{
c = map.directions.polyline.getPoint(i);
map.recenterOrPanToLatLng(c);
map.setMarkerPosition(map.me, N.get("local"), c);
if (i < map.direct...
I have a webpage with DHTML navigation menu. On the page also have an embedded flash object. Currently when I activated a DHTML menu, the opened menu items list appear below the flash.
How could I make the DHTML menu items to appear on top of the flash object. I reckon that there will be an attribute that we could use while writing or ...
How can I write this jQuery code in plain Javascript?
I can't use jQuery where this is going to be used.
$(function(){
$("td#dark[height='260']").append("<a href='http://www.website.com'></a>");
});
...
I am trying to write a Thunderbird extension which will let you compose a message but it will process the message text before sending it out. So I need access to the plain text content of the email body.
Here is what I have so far, just as some test code in the Extension Developer Javascript console.
var composer = document.getElement...
I am doing web development.
I have a page to do with credit card, which when user click "refresh" or "Back", the transaction will be performed one more time, which is unwanted.
This include Browser top left "Back" & "Refresh" button, "right click->Refresh/Back", press "F5" key.
This is to be done on certain cgi page only, not all of the...