I'm currently trying out websockets, creating a client in JavaScript and a server in Python.
I'm stuck on a simple problem, though: when I send something from the client to the server it always contains a special ending character, but I don't know how to remove it.
I've tried data[:-1] thinking that would get rid of it, but it didn't.
...
So I noticed that when I do an opacity change to a text or link element in Firefox (3.6+) on Windows, along with an opacity change, the color changes as well. For example, the blue text link shifts to a yellow just before it disappears.
Have a look at http://linowski.ca/experiments/onproximity/ and move to and from the text link named ...
I have several domains that point to the same site, some of them ending in ".br" (domain for Brazil, thus for portuguese speakers)
I want to detect from what domain the person came (.br or not) and load the correct landuage...
I can use PHP, JavaScript or standard HTML/CSS etc... How I do it? (and with what?)
...
The scenario is I have a list of items in HTML; when I click on an item I use JS to dynamically create the HTML to load a silverlight app passing in the specific item # (using initParams); and my silverlight app visualizes this in a nice way. I do this on the same page rather than loading a new webpage, and the transition is smooth.
I ...
Why doesn't the following code wrap the image with <li> tags and what would be the best way to do this?
var i = new Image
i.src = '/images/image.jpeg'
$(i).wrap('<li />')
$('div').html(i)
produces:
<div><img src="/images/image.jpeg"></div>
instead desired:
<div><li><img src="/images/image.jpeg"></li></div>
...
To me, this is the obvious way to do this. This being : given a start point and an end point, tell me if the end point is up / down / left / upleft / downright... etc of the start point. Heres the core of the logic :
function getSector() {
var y = startY - endY;
var x = startX - endX;
var angle = Math.atan2(y,x) * 57.29578;/...
I'm combining my javascript into MD5-digest-versioned files. I have a lot of js libraries that don't change very often. Then I have a set of in-house libraries that change somewhat frequently, and another set of application-specific files that changes constantly. I'm wondering if it's worth the effort to combine javascript into three sep...
I am using Google AJAX Feed to handle the RSS, then I store the data in my database.
but I encountered a problem :
how to read all data which updated since last time I read it (and I will lose some items),
thanks
...
I have an https page (https://example.com/main.php) that has an iframe with a non-https source (http://example.com/inner.php). Both files are on the same server - just one is accessed with https and the other is not. I need the non-https page to be able to execute javascript on the https main.php page using code such as parent.myfunction...
I have been working on a new feature for a facebook game I have written. The game allows a player to travel between cities in Europe and deliver goods for profit. This feature that I'm adding adds pathfinding AI to the game: it allows a player to select a city to travel to, then the game automatically moves the player's train along track...
I've got this code throwing an error from an iframe:
function parentIframeResize()
{
var height = getParam('height');
// This works as our parent's parent is on our domain..
parent.parent.resizeIframe(height);
}
Not concerned about the error at all. The problem is it stop...
I used a webkit to show a flash , but now I want to add a play button and control the flash , How to do ? thank you very much!
...
i have copied this code from the FB.init documentation:
<script src="http://static.ak.connect.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php/en_US" type="text/javascript"></script>
...
<!-- facebook JS SDK init -->
<div id="fb-root"></div>
<script>
window.fbAsyncInit = function() {
...
According to the jQuery docs, I need to escape metacharacters that occur in my selector strings, when they occur as a literal. However, I couldn't find very many specific examples of when and when not to escape selectors. So when and when don't I need to escape metacharacters, when they are to be interpreted as a literal, in:
Attribute ...
I am trying to use tabs on my page and each tab is loaded through the .load() javascript function. When I click on the first tab, I have the qTip tooltip provide a tooltip over each cell in a column of the table that is created. The tooltip works perfectly here. When I click on the second tab, the same thing happens to the table that is ...
I'm writing a jQuery plugin, and I'm writing it in a non-jquery-community-standard way, mainly
to maintain portability and extendability.
I'm having some trouble accessing variables that were declared in the function when accessing from the prototype.
Perhaps I have this model very wrong but I hope someone can point out the correct...
I have an onchange event that updates a form, and in the updating process it calls a function to calculate shipping. I'm not sure why, but I'm getting the following error when I try to call the function:
Uncaught TypeError: number is not a function
The function, shipping, looks like this:
function shipping( weight )
{
var flat
...
I was reading this article and came across this:
Gmail engineer Adam de Boor surprised the audience by noting that the company's Gmail service was written entirely in JavaScript, and that all of its code, around 443,000 lines worth, was written by hand.
Assuming he wasn't talking about GWT, that's a ton of JavaScript code. It made ...
It appears that sometimes object.setAttribute(attrib,value) isn't equivalent to object.attrib=value in javascript?
I've got the following code, which works fine:
var lastMonthBn = document.createElement('input');
lastMonthBn.value='<'; // This works fine
lastMonthBn.type='button'; // This works fine
But the following code doesn't...
HTML code:
div id="updatePanel">
jQuery code:
var data=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
$.each(data, function(index, value) {
setTimeout(function(){
$('#updatePanel').text(index);
}, 5000 );
});
I want the updatePanel div content to be updated every 5 seconds. It should be 1 then wait 5 seconds, display 2, wait for...