Hello,
I have an HTML textarea element. I want to prevent a user from entering any HTML tags in this area. How do I detect if a user has entered any HTML a textarea with JavaScript?
Thank you
In Python I can use the iterkeys() method to iterate over the keys of a dictionary. For example:
mydict = {'a': [3,5,6,43,3,6,3,],
'b': [87,65,3,45,7,8],
'c': [34,57,8,9,9,2],}
for k in mydict.iterkeys():
print k
gives me:
a
c
b
How can I do something similar in Javascript?
I have an aspx that has the following javascript function being ran during the onload event of the body.
<body onload="startClock();">
However, I'm setting the aspx up to use a master page, so the body tag doesn't exist in the aspx anymore. How do I go about registering the startClock function to run when the page is hit and still have it use a masterpage?
To create a digital signature with the client certificate in javascript, there was a function: crypto.signtext() that doesn't work anymore
What is the easiest way to do this now?
I have some third-party Javascript that has statements like this:
FOO = function() {
...functions() ...
return { hash }
}();
It is working as designed but I'm confused by it. Can anybody define what this structure is doing? Is it just a weird way to create a class?
Hi all,
I would like to know if it's possible to use javascript to open a popup window containing an image, and at the same time have the print dialog show. Once someone clicks on print, the popup closes.
Is this easily attainable?
Hi
I have ArrayList in my Model and want to iterate through it in my javascript. I am using following code but its giving me error : CS0103: The name 'i' does not exist in the current context
for(var i=0; i <= <%=Model.KeyList.Count%>; i++)
{
alert('<%=Model.KeyList[i]%>');
}
How to get rid of this. its urgent...Please.
I want to valid if user has entered username and password at the time of creating an account is safe or not based on its length(for my case five) on the right side of input field by showing that in different color i.e. for shorter in red, otherwise in green. How can I do that with javascript?
Hi ,
i have few numbers like
0011,0101,0123,1234,5245,0052,3265,0047,0124
How replace prefix zero only,
like no number should start with zero ,
exactly like
0011 should be 11 ,
0101 should be 101 ,
0123 should be 123
How to do this ?
Is ther any javascript function there ,
Thanks
Hi,
I have a <div id="one">this is a sentence</div>
I have a textbox for userinput, if the user types a word which matches any word in div, eg: if user types "this", which is also there in div value, the background color of "this" should be changed, using Javascript
Thanks
Sunny.
I need a javascript to replace i into I. This should apply to cases such as
i'm good.
So am i.
He though i love him.
The standard ThisContent = ThisContent.replace("i", "I"); doesn't work because it replaces every i. I also thought of ThisContent = ThisContent.replace(" i ", " I "); but it doesn't work for the first and second case.
Any idea?
Hello, this is quite a simple question hopefully.
Our client currently has a Flash banner ad on their site which they can change the text size, colour, position etc. by editing an XML file. They want to scrap flash and use JavaScript and jQuery. Now, as long as the XML file is at a readable URL I should be able make an AJAX request for the file and use it. Is that correct?
Many thanks
Hi,
Let us say I have a restful web service which can deal with DTOs in json format to perform a CRUD operation.
Let us also say I use jquery in an unobtrusive way to serialise my form at the frontend using:
JSON.stringify
What can I do to ensure that everything works even if JavaScript is switched off?
Thanks.
Best wishes,
Christian
I'm trying to find something like this: http://coffeescripter.com/code/ad-gallery/ that is controlled by an xml file that can simply contain the image location, thumbnail location and the text for title/description. Has to be pure jquery or javascript though - no flash based stuff.
I've found loads of great components but can't find one that is controlled by XML. Anyone happen to have seen one around anywhere please?
I have a problem that I have been trying to figure out and haven't been able to get past it because Chrome/FireFox/IE do not publicly publish their "rules" for pop up blocking when it comes to JavaScript, Flash, etc. I am trying to trigger a window.open() when a user clicks anywhere on page. I've tried this:
document.onclick = window.open("http://msn.com");
But all 3 browsers are blocking the popup, even though it is a user interaction.
Hi,
I wrote an ajax program.when i am getting response, at that time i will display
that content in my web page using html tags.
So how can I use html tags in javascript?
Is here a convenient way to quote a large block of HTML that has both single and double quotes in JavaScript? Is there anything like a HERE-doc <<EOF, a multi-quote character """, or custom delimiters q{}?
Any creative or inventive solutions to this problem?
How is it possible to make a input field editable in javascript. I mean onFocus putting it in insert mode so that values can be overwritten. Any suggestions ???
So I have a textarea containing text. I want to be able to display a tooltip when my mouse is hovered a certain word inside the textarea.
Is this possible at all? I would prefer to see a solution that doesn't use any third party javascript libraries.
Thanks!
I'm trying to insert/load javascript (e.g. prototype/jquery) into the iFrame generated by TinyMCE (tinymce.moxiecode.com) or YUI's text editor (http://developer.yahoo.com/yui/editor/) so as to better manipulate the objects/images/DIVs inside it.
Any thoughts?
In PDF files it is quite easy to interact with form fields via the Javascript API.
Is it possible to do this (specifically showing/hiding) to arbitrary elements on a page? Say, not just form fields, but text, graphical elements, embedded images... Is there an API to interact with those?
If yes, how do I identify an object?