My question is, how does Facebook, Omegle, and major chat applications code the title change on new message system. I want to, on change of a div, to change the <title> tag to something else than it already is set as. This is most likely accomplished in Javascript, but I'm not an expert in Javascript, so how is this written?
...
I'm using the jQuery Slider plugin (jqueryui.com/demos/slider/)
I'm calling the plugin with the following Javascript:
$(function(){
$("#slider-price").slider({
range: true,
min: 0,
max: 5000000,
step: 100000,
values: [0, 5000000],
slide: function(event, ui) {
$("#amount").val('£' + ui.values[0] + ' - £' + ui.values[1]);
...
I had a case where i copied bold text from a web page into a textarea of another page. On paste, the text area kept the text's bold format. When i pasted the same text into a text file i could see no mark ups or formatting info along with the text. How is the textarea keeping the format of the text?
Thanks in advance.
EDIT:
How i...
I need a jQuery code snippet which appends the parameter action=xyz to all urls within a page - note it should also check that if the urls already have other parameters appended or not: e.g., for a url such as index.php?i=1 it should append &action=xyz and for urls without parameters like index.php it should append ?action=xyz.
...
I have added two rows to a jsp which are displayed one at a time based on the text entered. There are two other rows which are already existing and they are displayed based on their own conditions not related to my changes. All this process works fine in IE6, Chrome, Opera 10 and Safari 4. Except Firefox 3.6: my two rows are displayed as...
In JavaScript, if I run the following code:
<script type="text/javascript">
var nameStr = 'Chris Kate Steve';
var names = nameStr.split(/[ ]/);
var names2 = nameStr.split(' ');
for (var i in names)
{
alert(i);
}
for (var i in names2)
{
alert(i);
}
</script>
It will alert:
0
1
2
index
input
For the f...
The same origin policy
I wanted to make a community wiki regarding HTML/JS same-origin policies to hopefully help anyone searching for this topic. This is one of the most searched-for topics on SO and there is no consolidated wiki for it so here I go :)
The same origin policy prevents a
document or script loaded from one
origin ...
I've put facebook like buttons into my wordpress blog... the idea is to use them as kind of a voting mechanism for posts. What I would like to do is automatically add a comment for the blog post everytime someone 'likes' it via the facebook like button.
So my question is- does the like button api provide some kind of a callback to my pa...
Hello,
going to http://revyu.com/sparql?query=SELECT+%2A+WHERE+%7B%7D works totally fine by returning an XML file, but as soon as I use jQuery, I'm getting errors:
var sparql="SELECT * WHERE {}";
var query = 'http://revyu.com/sparql?query=' + escape(sparql);
$.ajax( {
dataType: "xml",
url : query,
success : f...
I have this type of code for prototypal inheritance in Javascript.
function A() {
this.a = 1;
}
function B() {
someEl.innerHTML(this.a);
}
B.prototype = new A();
However, I am wondering if there is a better way to do it, preferably one that brings the prototype declaration into the declaration of B.
I tried setting this.proto...
I have an <input> textbox.
I wish to call a function when it has been modified. The default behavior of the change event is to only trigger on blur, but I need to call my function as soon as the textbox's text changes and can't wait for blur.
I'm not sure the best way to do this. I thought of maybe handling keydown and then testing th...
I'm doing an AJAX fetch of a binary file the I am parsing in javascript. (Quake 2 BSPs, if anyone cares.) The code to fetch and parse the initial file is working fine, and looks roughly like this:
function loadFile(url) {
var request = new XMLHttpRequest();
request.onreadystatechange = function () {
if (request.readySta...
Hi
If the Microsoft Web Protection Library can have custom white-lists http://wpl.codeplex.com/
I am also wondering do you need to do anything special to get it to work with asp.net mvc?
I am going through it's methods and I see
AntiXss..::.GetSafeHtml
AntiXss..::.GetSafeHtmlFragment Method
AntiXss..::.HtmlEncode Method
AntiXss.....
Dear all,
I have a problem using balloons in google earth.
I have some markers on the map, upon clicking on a marker, a balloon popup is shown containing some data, now when I click on the close button of that balloon, the click event of the map is also triggered which is really annoying as I have a handler attached with the map click e...
I have a Media Player (type application/x-mplayer2) embedded in my website, which plays a .M3U file playlist of .MP3 files with Album Art embedded in each file. I would really like to have the Album Art for each .MP3 displayed when the player plays the .MP3. Could someone show me, or direct me to, the code for this display?
tqasolutio...
I want to stop propagation of this div's onclick event to the document? When the user click on the "div", both alerts appear: 1) the div's alert and 2) the document's alert. I want to suppress the document alert.
I know how to do it using addEventListener, but is there another way to to do it? The problem below is that I don't know h...
i'm writing some inline javascript. it's not working and i'm not sure why.
at the top of the index page
<meta http-equiv="Content-Script-Type" content="text/javascript" />
later on i have:
<select name='id'>
<option value=-1>New Entry</option>
<option value='1' onclick="location.replace('index.php?page=update&id=1')">2010-06-12 ...
How to correctly do something like the following without using jQuery.
$(document).ready(function(){
$("#someButton").click(function(){
alert("Hello");
});
});
Thanks.
...
Hi,
Im using date.js to compare to dates that are written in user friendly string form(Sat, 1 July 2006 12:34:14). I use this code.
function is_new(lasttime, newtime){
lasttime = Date.parse(lastime);
newtime = Date.parse(newtime);
if(lasttime.isBefore(newtime)){
return true;
}else{
return false;
}
}
...
Hi all, I have a form that is sending data to a MySQL database and I want to make sure several of the fields are not left blank. I think I can figure out how to do this with JavaScript, but my question is should I? When I made the database table that I am working with I made the fields that I want to make sure are filled out NOT NULL t...