I'm currently using spidermonkey to run my javascript code. I'm wondering if there's a function to get input from the console similar to how python does this:
var = raw_input()
Or in C++:
cin >> var;
I've looked around and all I've found so far is how to get input from the browser using the prompt() and confirm() functions.
...
On load I'm both calling a JavaScript setTimeout() function that will hide a .NET Panel control, and hiding it in the code behind on first load. Clicking the save button will set the Panel to visible then reload the page at which point a setTimeout() function is called... so basically you click save, and see a panel with "Details Saved"...
I've read that javascript gets significant performance benefits from modifying off-dom. Earlier today, I was reading the clone documentation:
"Note that when using the .clone()
method, we can modify the cloned
elements or their contents before
(re-)inserting them into the
document."
Is the implication then that if I have 1,...
I am using a star rating plugin with ExtJS that is working well, but I need to reset the displayValue after the click event. I also have a json object with {'rating':'#'} but I cannot figure out how to have ExtJS correlate this value with the Rater's displayValue property. It seems that I set it after the component is already rendered, b...
I'm using the following code to allow users to resize a DIV element vertically, but when the click and drag the handle, text and other elements on the page get selected as if the user was just clicking and highlighting everything on the page. Is there a way to prevent this from happening as this looks very bad? This is being used with ...
I want to control how easily people can leave my app. Now, I know I can't do it completely; that's what cron jobs are for. But I'd like to catch as many cases as possible.
I thought, I could use onBeforeUnload to display the dialog box, warning them about leaving and asking them to please click the Quit button instead.
But then I found...
Before the "beating a dead horse" comments begin, let me clarify what I am trying to do to see if someone can help me.
I have a parent window with an iFrame in it. The content in the iFrame is loaded from a separate domain which is where I think my problems begin, although it needs to be this way. When the page originally loads I have t...
Hello ,
I'm working with a nice little Jquery that auto loads and refreshes a div every bla bla Seconds.
Works perfectly on all browsers then I load up IE and bang what a surprise no luck! :(
Index.html
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/
libs/jquery/1.3.0/jquery.min.js"></script>
<script type="text/j...
I'm trying to make any '@sometext' an HTML link where 'sometext' is also appended to a url. i.e. '@sometext' becomes a link to 'http://someurl.com/sometext'. But so it can change because the link will be different everytime depending on what 'sometext' is. I'm writing this in javascript and jquery. I'm trying to recreate links similar to...
The problem:
On my webspace there are PHP files which all end with this:
<?php include 'footer.php'; ?>
Before this line, there is also HTML code in the files.
The output in the browser ends with this, of course:
</body>
</html>
But yesterday, there was some malicious code at the end, suddenly. The output of my index.php was:
</...
I am using the new Google Maps v3 STYLED MAP.
I want to change how the map is Styled based on the zoom level.
I have the following pseudo-code, how do change my map-style based on the zoom level?
var myOptions = {
zoom: zoom,
center: latlng,
disableDefaultUI: true,
navigationControl: true,...
Hi
I am trying to load my print.css but it does not seem to be loading. it work Fine in FF and Safari but the problem is only in IE.
I have the regular external css for the page inbetween the head tags
And when the user click on the print link . it loads the print css .
<div class="linkPrint">
<a target="_blank" href="?format=prin...
I have a view that will create a table while enumerating over each item in my model.
to each row I need to add a button.
I need would like to have a jquery function tied to each button to show an alert when it is clicked. the text will be different depending on the row item that is clicked, so I must know what row the edit button is in t...
Do any browsers currently support or plan to support fast array math operations, similar to what NumPy provides for Python? Here is an example to demonstrate what I mean:
var a = new NumericArray('uint32', [1, 2, 3, 4]);
var b = new NumericArray('uint32', [2, 2, 2, 2]);
var c = a.add(b); // c == [3, 4, 5, 6]
In that example, add is no...
I have this for loop, and it seems to be repeating the first loop twice (x=0) and then not doing the last one (x=2)
for (x=0;x<=2;x++)
{
if (document.getElementById("sub"+catCount+x).value != "")
{
if (nonums.test(document.getElementById("sub"+catCount+x).value))
{
total = tota...
I have seen a syntax such as the following before:
var mynum = new Number();
var temp = (+mynum); //this line is what i am curious about
var text = temp.toPrecision(3);
Can anyone tell me what this + syntax means?
What I have found is that in some JS implementations, it is somehow necessary as it ensures that the number defined in my...
I'd like to know if there is a better approach to creating re-usable ajax object for jquery.
This is my un-tested code.
var sender = {
function ajax(url, type, dataType, callback) {
$.ajax({
url: url,
type: type,
dataType: dataType,
beforeSend: function() {
o...
Hi,
I know there have been a lot of topics like this but I just have problem to which I couldn't find the answer.
My script is:
window.onload = function(){
// 200 seconds countdown
var countdown = 14400;
//current timestamp
var now = Date.parse(new Date());
//ready should be stored in your cookie
if ( !docum...
Hi,
I’m trying to insert the url from an onlick event in the the radio buttonsto the href link but it not working. Here’s I have so far.
<input type="radio" name="orderID" value="1" onclick="javascript:document.getElementById('editBTN').href='forms/editForm.cfm?orderID ='&this.value">
<input type="radio" name=" orderID " value="2" o...
The iphone app im writing displays an html page, i would like to add a search feature where the user can search for instances for the keyword and highlighted (like in firefox ctrl+F)
what's the best way to do this? in objective-c? would this be even possible with javascript?
...