I need to create a chat like facebook chat.
With Comet I need more memory to keep the connection.
With Ajax polling there is a latency problem if I send request every 3-4 seconds.
So... If the latency ( 3-4 seconds ) doesn't matter, Is Ajax Polling better for my case ?
...
At my wits end here , any help appreciated
In my json javascript live pull I have
html += "<tr><td width=60 valign=top><a href='"+item.url+"' target='_blank'>"+item.site+"</a></td>";
The += seems to strip out my tr td values
So I tried amending it to = which just seems to fail.. I tried setting td as a var and still no luck
Any...
I'm having a bit of a problem escaping quotes in the following example:
var newId = "New Id number for this line";
$(id).html('<td><input type="text" id="my' + newId + '" onKeyUp="runFunction("#my' + newId + '");"></td>');
The issue is that when I look at the generated code the id does update to id="myNewId", but in the function call...
Hi,
have a problem with my ajax code.
I have some links and a content area.
When i click on a link, i hide the content area, load the new data and show the content area again. It works, but when showing the content area, you see the old content for a short time and then it flickers to the new content.
Can i somehow let the loading scre...
http://code.google.com/intl/fi-FI/apis/maps/documentation/javascript/examples/map-geolocation.html
I get a grey page with latest Google Chrome (access to location allowed for this website), but no error messages. Ideas?
...
I wrote a javascript function that uses the innerHtml of a named div (that occurs immediately after the script) for each row as output. the problem is, if I use $('divname'), it always finds the first instance, not the nearest. What's the simplest way in prototype to target the nearest "divname" div?
eg (note, I'm using Grails, hence th...
This is a classic sort of question, I suppose, but it seems that most people are interested in having the textbox cause a postback. I'm not. I just want the event to fire when a postback occurs.
I have created a webpart with a custom editorpart. The editorpart renders with a textbox and a button. Clicking the button causes a dialog t...
$(document).ready(function () {
//create the div
var div = $("<div></div>").css("position", "absolute").text("a short message").appendTo("body");
//attach the mousemove event
$("body").bind('mousemove', function(evt) {
div.css({
"left": evt.pageX + "px",
"top": evt.pageY + "px"
});
});
});
what im trying to ...
Possible Duplicate:
Is it valid to replace with // in a <script src=>?
I'm starting to see more and more script references show up like so:
<script type="text/javascript" src="//somedomain.com/somescript.js"></script>
Note the lack of http: at the beginning of the src attribute.
It seems to work fine and avoids the messy ...
I need to change the shipping carrier drop-down and shipping method radio button once via a javascript function, not forever.
However, when I use this function, which executes when on the Review and Submit page when the order is < $5, it goes into an endless loop:
function setFreeSampShipping(){
var options = document.forms['checkout'...
I've had lots of success in getting IE to play nice in the past, but I'm buffaloed here. The dropdown menu is visible and works, but it's having some margin/padding issues and no matter what kind of conditional statement or hack I try to employ, it won't straighten out.
Example page: www.erisdesigns.net
HTML (links removed so that I c...
I feel daft asking such a question here but I couldn't find any solution to it.
I have two external js lib files I have to load on same jsp page. They both have a function called "autoSave()" both without parameters. I cannot modify their signature as they are not my script files.
How can I call function in script A or script B expli...
Hey everyone,
I'm a newbie using jquery and js either, so maybe thats the reason why i just cant undesrand why my code isn't working.
I created this function createList to push image content into div element. (this part works great)
So what i want to do is, creating an element witch holds every picture and after i have deleted the cont...
I was told IBM no-longer uses Dojo. Is this true? A small amount of web searching shows IBM is/was a member of the Dojo Foundation and is/was a code contributor... If it is true, approximately when did IBM stop using Dojo? If its not, to what extend is IBM still actively using and promoting the toolkit (use in their public web sites, pro...
All of the MongoDB MapReduce examples I have seen have dealt with counting/adding numbers. I need to combine strings, and it looks like MapReduce is the best tool for the job. I have a large MongoDB collection in this format:
{name: userone, type: typeone}
{name: usertwo, type: typetwo}
{name: userthree, type: typeone}
Each name only ...
I have built a class in Mootools and extended it twice, such that there is a grandparent, parent, and child relationship:
var SomeClass1 = new Class({
initialize: function() {
// Code
},
doSomething: function() {
// Code
}
});
var SomeClass2 = new Class({
Extends: SomeClass1,
initialize: function() {
this.parent...
I have some JavaScript/jQuery code that watches for the "changed" event on a checkbox:
$(control).change(function() {
alert("changed to: " + $(this).is(":checked"));
});
This works fine.
I'd like to create a reference to the change() function on the particular object, and call it indirectly, like so:
var onSomeChange = $(control...
Hi There,
I am reading up on creating custom jQuery plugins and am a little confused as to the meaning of the following syntax:
(function($){
$.fn.truncate = function() {
return this.each(function() {
});
};
})(jQuery);
I understand that function($) is an anonymous function that accepts the $. I just don'...
Hi,
I have this stylesheet:
.pixel{
position: absolute;
height: 10px;
width: 10px;
background-color: #ffcc00;
font-size: 0px;
}
And this javascript:
function drawpixel(x,y){
el = document.createElement('div');
el.setAttribute('class','pixel');
el.style.left = x;
el.style.top = y;
/* IE needs...
While firefox manages, ie and chrome refuse to collapse the div any further than the height of the picture. Additionally (but minor), ie (properly?) wraps the text around the picture, while firefox for some reason i can't figure out has the text seem to float right.
Thanks for any help!
The javascript:
window.addEvent('domready', func...