In Firefox 3, when I open a new window (or tab), using window.open, the new window has focus, which is what I want.
In IE, the old window still has focus for some reason, so I have researched the problem my window.open code does this now.
var w = window.open("Sheet.aspx", "_blank");
w.focus();
Unfortunately, this isn't working fo...
Hi, I have created a messaging system which allows users to send messages to eachother. This works fine but when they reply I dont want them being taken to another page, I want a alert to say "sent" or "not sent". Below is my code which doesnt work.
in php:
echo"<form id=\"form\" name=\"form\" method=\"post\" onsubmit=\"send(reply)\">...
I know that I can use $.html to set the HTML content of something, and $.text to set the content (and that this escapes the HTML).
Unfortunately, I'm using $.append, which doesn't escape the HTML.
I've got something like this:
function onTimer() {
$.getJSON(url, function(data) {
$.each(data, function(i, item) {
...
I have some very simple sample code like this:
$.ajax({
url: 'demo2.htm',
success: function(loadeddata){
$("#loaded_data").after(loadeddata);
alert('success');
},
error: function(){
alert('failure');
}
});
Loaded data currently returns everything. What I need to is to get only a specific div and after it add it t...
Hi there,
can anyone help, i have an issue with the keyword this.. before entering the ajax call its available but when entering Success. my "this" is available but doesn't contain the same info i.e. a method i wish to call.. This example shows what i mean..
I would appreciate any help, this.isoDateReviver is available before doing aja...
I have a situation where, in javascript, I need to compare the contents of one string to see if it contains the exact same number in another string that could contain multiple numbers.
For example.
Source: "1234"
Comparison: "1000 12345 112345 1234 2000"
It should only match on the 1234 and not on the 12345 or 112345, etc.
It also n...
Hi, I am trying to do pretty much the same, as is for example on sourceforge. After a user creates some data, i generate a file and i want it to be offered to him after a page loads. However, i know almost nothing about javascript and simple copy paste of
< script type="text/javascript">
var download_url = "http://downloads.sourceforge....
I am trying to use the typeWatch plugin for jQuery. I have this javascript:
<script type="text/javascript">
$(document).ready(function() {
var options = {
callback: function() { alert("a-ok! " + $(this).text); },
wait: 333,
highlight: true,
captureLength: 1
}
$("#customer").typeWatch(optio...
Hi guys,
I have a function called "go()" which needs to be called thrice on page load. Right now I have called it on the ready event of a div with class "nav". Can someone suggest how can I call the go function thrice. Adding go() calls one after other calls it only once.
$('.nav').ready(function() {
go();
});
...
What is this doing exactly?
this.$blah = jQuery("<div id=blahblah1></div>");
...
Hello. I'm generating JSON response from PHP witch looks like this:
{ done:'1', options: [{ message:'Example message'},{message:'This is the 2nd example message'}]}
I want to grab these results using ExtJS. This is what I have so far:
Ext.Ajax.request({
loadMask: true,
url: 'myfile.php',
params: {id: "1"}
});
What d...
{"something":"1","mode":"true","number":"1234"}
Because I'm getting a 406 on expecting JSON.
It's being generated via Jersey, which is told that a method @Produces JSON. It's being received by a Dojo xhrGet which has JSON set as its handleAs.
EDIT - To clarify, I'm not interested in the code where I evaluate or anything like that. Th...
Quick Question. Eval in JavaScript is unsafe is it not? I have a JSON object as a string and I need to turn it into an actual object so I can obtain the data:
function PopulateSeriesFields(result)
{
data = eval('(' + result + ')');
var myFakeExample = data.exampleType
}
If it helps I am using the $.ajax method from jQuery.
T...
I don't have a use case for this but I was recently asked this very question and w3schools helpfully tells you the characters are ignored but not why.
Anyone have any idea why this might be the case?
Thanks,
David
...
Hello,
I have the following menu in my masterpage:
<ul id="menu" class="lavaLampBottomStyle">
<li>
<%= Html.ActionLink("Employees", "Index", "Employees")%></li>
<li>
<%= Html.ActionLink("Customer", "Details", "Account")%></li>
</ul>
I need a way to set the css class of the current active li to "current".
My ...
<script>
function Hello(){
var caller = arguments.callee.caller;
alert( caller );
}
</script>
<input type="button" id="btnHello" value="Hello" onclick="Hello()" />
How to get the button id from the the Hello function above with out passing the any argument in the Hello function
...
Are there any JavaScript libraries or Toolkits that allow me to bind the JSON data to html controls on the client?
So essentially I should be able specify the object property to which a html control should be bound. Hence when the form receives the JSON data, the controls are updated, and when the controls are updated, the data should b...
i wrote this and wanna start and end the loop with certain colors
(e.g. start with rgb 150,150,200; end with rgb 190, 160, 200):
<!DOCTYPE HTML>
<html>
<head>
</head>
<body>
<canvas width="400" height="100"></canvas>
<script>
var context = document.getElementsByTagName('canvas')[0].getContext('2d');
var lastX = contex...
Hi,
I'm using a javascript function that receives some html code that was included using php.
It is not html in a php string but an html file with .php extension.
As the html code is sent as a parameter to the js function it can't contain carriage returns. The problem is that writing big blocks of html in a single line is terrible, I w...
Is there a way to test what fonts are installed or maybe a way I can read out all of them? I want to do a survey in our product to see what fonts I can use on our projects.
...