I'd like to be able to allow community members to supply their own javascript code for others to use, because the users' imaginations are collectively far greater than anything I could think of.
But this raises the inherent question of security, particularly when the purpose is to allow external code to run.
So, can I just ban eval() f...
Hi
This is one of those situations where I've had to pick up and run with a new tech without having time to learn the foundations!
I have the following js function which calls out to PrintService, which returns me the HTML to inject into a div:
function showPrintDialog() {
$.ajax({
type: "POST",
...
I had Put a digg button in my blog. The blog runs fine on firefox and opera,but when i open it in ie7 it shows javascript error.clicking on that little triangle doesn't show any information..how to remove that error?
...
I want to pass an Array to a template and afterwards use it via JavaScript.
In my views.py I have:
arry1= ['Str',500,20]
return render_to_response('test.html', {'array1': arry1})
var array1 = {{ array1 }};
but when I visit the website it puts out:
var array1 = [_39;Str_39;,500,20]; (without the _ sign (otherwise stackoverflow change...
how can i call a VB function - deleteevent() in usercontrol.ascx.vb from a javascript function in clickhandler(e) in usercontrol.ascx. The call should cause a postback because i need the usercontrol to display the changes.
i am currently trying to do it by using a linkbutton with style display:none, and calling its click event from the ...
I've a Javascript source that uses a Java class that defines a "delete" method (using jdk6 scripting). Since delete is a keyword, I cannot invoke that method.
In JavaFX script any sequence of characters enclosed in <> is treated as a lexical identifier. So you can use "insert", that is a keyword, as an identifier:
var textField = new ...
From what I've ready you should be able to use the 'value' property of a file input field to get the currently set path of that field. But when I do this:
$('#fileinput').value()
I get 'undefined'. The ID of the field is set to "fileinput" I'm sure. Does anyone have any thoughts on why this might not be working for me?
And by the...
If you open a text file (.txt, .js, .css, ...) in your browser, it will get wrapped up in a nice DOM tree.
For example, open this .txt file and enter
javascript:alert(document.documentElement.innerHTML);
into your address bar. Nice... every major browser supports DOM manipulation on this wrapped text files, which is a great thing for...
What's the easiest way to add an option to a dropdown using javascript? Can this work?
$("#mySelect").append('<option value=1>My option</option>');
...
I am considering creating a website that only supports users with JavaScript enabled.
My justification for this is that I want to offer a rich user experience, in a fairly limited time budget, so if I only support people who have JS enabled, I don't have to spend time making sure the UI works without JS and create server side equivalent...
I use my own library for a lot of stuff, and recently I decided to add gradient functionality, but I've encountered a problem that I seem to remember having a while ago also, and this is the matter of my gradient being slightly off near the end. First, the code in question:
gradient = function(l, g)
{
var r = [], s = [], f = g.length -...
How can I get the following JavaScript to return row so I can access it outside the transaction? All of Apple's example code seems to have HTML written to the browser within the transaction instead of ever passing data back to a calling function.
Along the lines of:
function getData() {
db.transaction(function(tx) {
tx.executeSql...
What is the expression I should use in order to check for a valid url in javascript?
...
If I have a popup (using a div), how can I have the div to go back to the hidden state when someone clicks anywhere outside of the div?
i.e. the popup is visible, then someone clicks outside the popup, the div should be hidden again.
How can I achieve this functionality?
...
For some reason the script below is unable to get the id of the draggable divs using attr('id'), but it works on the other static elements on the page. I am totally confused as to why this wont work and if anyone has a solution for me it would me much appreciated.
$(document).ready(function(){
//$(".draggable").d...
How do I edit the selected text of a textarea form element?
EDIT: as in edit it in-place, replacing the orignal text.
...
I have a click event I wired up on a div on my page.
Once the click event has fired, I want to unbind the event on that div.
How can I do this? Can I unbind it in the click event handler itself?
...
I would like to implement a text box with a 140 character limit in Javascript such that when the 141st character is added that character is erased.
I don't want to show any message or alert to user they have exceeded the limit. There is already a counter.re.
Here is an example of what I want to do: http://titletweets.com/category/games...
If I do an online onload event for embed objects, that seems to work but I can't seem to get the load event working through addEventListener. Is this expected?
...
In JavaScript, it doesn't seem to matter whether you use single quotes or double quotes when writing strings. However, some programming languages treat them differently.
Is one more reliable than the other across multiple programming languages? Are there any pros or cons using one rather than the other (apart from when apostrophes or qu...