Hi all,
my Code is like
$("#leaderBoard").html("<script2 language=\"javascript2\"> document.write('<scr'+'ipt language=\"javascript21.1\">alert(1)</scri'+'pt>'); </script2>".replace(/script2/gi, "script"));
ie8 not wirking at all. FF3 is exucuting but page gets blank and seems loading not ending.
someone has a clue?
i want to let pa...
I've recently started maintaining someone else's JavaScript code. I'm fixing bugs, adding features and also trying to tidy up the code and make it more consistent.
The previous developer uses two ways of declaring functions and I can't work out if there is a reason behind it, or not.
The two ways are:
var functionOne = function() {
...
Hello,
The code I have pasted below is meant to display images on the middle 2 links without text and go back to text on the reset and fourth link. I have set display:none for the span tag only, but it does nothing. Is there anyway to do what I am after simply, without using a framework?
edit: example
<html>
<head>
<style...
Hello, I hava an ajax application that will not display an image, or make a popup window from html stored in a file.
This is the code I am usiong for the popup:
echo '<script>
function makewindows(){
child1 = window.open ("about:blank");
child1.document.write(' . json_encode($row2["ARTICLE_DESC"]) . ');
child1.document.close();
}
</s...
When does script added to the page with Page.ClientScript.RegisterStartupScript() actually run? MSDN states "when the page finishes loading but before the page's OnLoad event is raised" but this isn't much detail.
For example, can a script added with RegisterStartupScript assume the DOM tree has been built? Does the behaviour differ bet...
Today one of my friends said:
if (typeof isoft == "undefined") var isoft = new Object();
is such kind of code is writted by a freshman and writes
if(!isoft) var isoft = new Object();
I originally consider there must be some difference. But I can't find the difference. Is
there any? Or are the two examples the same?
Thanks.
...
I'm starting a personal project, so I have at the moment complete architectural/design control. I'm just planning out the structure at this point. My goal is some sort of web forum, chat thing. The difference is it should update live, new posts growing on client views soon after they've hit the server.
I think to use ajax and jquery ...
I need to round decimal numbers to six places using JavaScript, but I need to consider legacy browsers so I can't rely on Number.toFixed
The big catch with toExponential, toFixed, and toPrecision is that they are fairly modern constructs not supported in Mozilla until Firefox version 1.5 (although IE supported the methods since vers...
I'm looking for a CMS system to manage a simple and small website. The website will be made with pure HTML and some JavaScript (perhaps prototype library).
The reason while I'm looking for a CMS system is, because the customer will have the ability to change the content later by him self, and of course he didn't have any experiences with...
I need to edit (using javascript) an SVG document embedded in an html page.
When the SVG is loaded, I can access the dom of the SVG and its elements. But I am not able to know if the SVG dom is ready or not, so I cant' perform default actions on the SVG when the html page is loaded.
To access the SVG dom, I use this code:
var svg = do...
The scenario:
I dynamically create an iframe and a form inside it via JavaScript.
The form is submitted via JavaScript and sends a POST request to a server.
The request is received, but the browser stays on loading status (the progress bar at the bottom of the window keeps progressing and doesn't stop, only happens after form submissio...
I'm hopeless at Javascript. This is what I have:
<script type="text/javascript">
function beginrefresh(){
var marquee=document.getElementById("marquee_text");//set the id of the target object
if(marquee.scrollLeft>=marquee.scrollWidth-parseInt(marquee.style.width))marquee.scrollLeft=0;
marquee.scrollLeft+=1;
setTimeout("beginrefresh()",...
I need to bitwise shift a value 64 times in JavaScript. But JavaScript starts rounding after 32.
For example:
for(var j = 0; j < 64; j++)
{
mask = mask << 1;
console.log(mask);
}
This prints value from 0 to 1073741824 but then rounds of and starts printing 0.
...
I create a file in JavaScript. Now I want to be able to make it available to the user as a download is this possible?
To be exact it is a KML File I create so its basic XML.
...
I'm currently building a project and I would like to make use of some simple javascript - I know some people have it disabled to prevent XSS and other things. Should I...
a) Use the simple javascript, those users with it disabled are missing out
b) Don't use the simple javascript, users with it enabled have to click a little more
c) C...
I'm attempting to add some text to the directions results the Google Maps API returns to the specified div (directionsPanel). This code below would work fine, except that the jQuery line fires before loadFromWaypoints has finished modifying the DOM. If I run that line by manually triggering it after the directions content has finished ...
I am trying to make a small, data-driven widget that is populated with data from a database on the fly. I can load it initially just fine, but when the index of an ASP DropDownMenu is changed, the widget returns a 404.
This could be a symptom of how I am using the Javascript, or how I am using the ASP. I honestly don't know for sure.
...
Using instance methods as callbacks for event handlers changes the scope of this from "My instance" to "Whatever just called the callback". So my code looks like this
function MyObject() {
this.doSomething = function() {
...
}
var self = this
$('#foobar').bind('click', function(){
self.doSomethng()
// this.doSomethi...
I've a couple of extension methods I've been developing for a couple of projects, they currently rely heavily on some AJAX to make bits and pieces work. The problem is that they require copying and pasting JavaScript files to the project you want to use it in.
As this JavaScript file only needs to be used once (all instances of the rend...
Here's the scenario:
My users are presented a grid, basically, a stripped down version of a spreadsheet. There are textboxes in each row in the grid. When they change a value in a textbox, I'm performing validation on their input, updating the collection that's driving the grid, and redrawing the subtotals on the page. This is all ha...