I'm trying to read in the value of selected text within a text area. Here is my code:
function readSelected(id)
{
textarea = document.getElementById(id);
if (document.selection)
{ //Code for IE
textarea.focus();
sel = document.selection.createRange();
alert(sel.text);
}
else
{ // Code ...
I am using jqGrid. One of the columns has the possible values:
Poor, Fair, Good, Very Good, Excellent, Ideal
But when you sort by this column they are ordered alphabetically like:
Excellent, Fair, Good, Ideal, Poor, Very Good
Instead of the intuitive order you would expect.
Is there a way to correct this?
update
Here is a snippe...
Hi Everyone
I am writing a code using Google-Ajax-Feed-API to get latest feeds from some site. I want the feeds to be checked for update every(say 1 secs?). I am able to retrieve the blogs but not able to refresh the DIV tags. Any help will be useful.
<script type="text/javascript">
google.load("feeds", "1");
$(documen...
Hi,
I am having trouble rendering a partial with javascript.
I need the javascript to be part of the document, but for some reason when inspecting the document the javascript is not there.
Is there a way to render a partial with javascript so it is part of the document?
...
$(document).ready(
function()
{
$('input[id^="btnRemoveCategory"]').bind(
'click',
function(){
if($('input[id^="chkIsBottom_":checked]'))
alert('YES YES YES!!!!');
else
alert('No NO no!!!!!');
I've tried with the:
if($('input[id^="chkIsBottom_"]').attr(chec...
Hi
Currently I am trying to send JSP value to javascript. Is it possible? My cases is as follows:
On Page abc.jsp, user enters data in form. Which is send on the next page xyz.jsp. I want to use this data in xyz.jsp pages javascript. Is it possible? Is yes how to do this?
also would like to know, if I auto refresh this page(or part of...
I have the following Action method.
public ActionResult Action()
{
var model = new SampleViewModel();
model.JsonString = ReadJsonStringFromSomewhere();
return ViewResult(model);
}
In my view I have the following method to initialize a javascript variable.
<script type="text/javascript">
var jsObject = eval("(" + <%= Mod...
i need to make a dictionary in javascript like this
i dont remember the exact notation, but it was something like:
states_dictionary={ CT=[alex,harry], AK=[liza,alex], TX=[fred, harry] ........ }
is there such a thing in javascript?
...
I'm attempting to integrate John Gruber's An Improved Liberal, Accurate Regex Pattern for Matching URLs into one of my Javascripts, but WebKit's inspector (in Google Chrome 5.0.375.125 for Mac) gives an "Invalid group" regular expression syntax error.
Gruber's original regexp is as follows:
(?i)\b((?:[a-z][\w-]+:(?:/{1,3}|[a-z0-9%])|ww...
Hi, and thanks for looking.
Currently I am implementing code from this example. In my aspx file, I have Label1 and Textbox1 defined. In my aspx.cs file, I am setting the Label1.Text property to a random string in the Page_Load method.
In the .js file I have included, I have:
var Label1, TextBox1;
Sys.Application.add_init(AppInit);
f...
In theory browsers could support several programming languages for client-side scripting of web pages. In practice, ECMAScript is the only one widely implemented and used in all browsers. So for most people, it is an integral part of the web.
However, it has never been promoted as a recommendation by the W3C for web page scripting. And ...
So I have a page in Windchill 9.1 that has a dynamic popup of a drop-down menu with a z-index of a 100. And for some reason the popup doesnt show up in the source code.
Using firebug I can see that the html code is being dynamically added onto the page and when I close out from the menu, the code becomes a lighter shade in firebug (may...
How does stackoverflow implement the "comments" section of this site? I'd like to create something similar to a FB Wall or okcupid.com profile edit.
My goal is to create a wiki of sorts that has editable regions like each of these sites. It's important that I can associate the user's cookie with the edit on the serverside so I can mai...
Is it possible to use the JavaScript jQuery framework with the HTML5 <canvas> element? Or do I have to do it with plain JavaScript.
I'm just wondering, because I think I could save a lot of time with using jQuery, but I have no clue about the <canvas> element's uses yet, so it may be completely impossible!
Anyone know if I can use jQu...
i am playing with the onmouseover event in javascript
i would like a little box to pop up and remain up until there is no onmouseover anymore
i think it's called a decription box, but i am not sure?
how do i get a little box to pop up with custom text when i put my mouse over certain text>? and i need it to disappear once i move the m...
Quick question...
Is there any way to change the default behavior of a scrollbar from moving one pixel at a time (continuous motion), to jumping say 100px at a time (less continuous more discrete jumps). I have an animation that jumps between pictures and I want to use the scrollbar to show one picture at a time.
Whenever I try chan...
What's it called when you declare javascript in the <head>? It's not external, and it's not inline...it's called something else. What is it?
<html>
<head>
<script type="text/javascript">
function message()
{
alert("This alert box was called with the onload event");
}
</script>
</head>
<body onload="message()">
</body>
</html>
edit: g...
here is the page where i need to add CSS:
http://upload.wikimedia.org/wikipedia/commons/a/a5/Map_of_USA_with_state_names.svg
since there is no body and header, where exactly would i paste the css?
here is what it looks like currently and it does not work?
somestyle.css
<style>
#tt {
position:absolute;
display:block;
background:url...
hello I am trying what I thought would be a rather easy regex in Javascript but is giving me lots of trouble.
I want the ability to split a date via javascript splitting either by a '-','.','/' and ' '.
var date = "02-25-2010";
var myregexp2 = new RegExp("-.");
dateArray = date.split(myregexp2);
What is the correct regex for this an...
i am getting this error on this code:
<style>
#tt {
position:absolute;
display:block;
background:url(images/tt_left.gif) top left no-repeat;
}
#tttop {
display:block;
height:5px;
margin-left:5px;
background:url(images/tt_top.gif) top right no-repeat;
overflow:hidden;
}
#ttcont {
display:block;
padding:2px 12px 3px 7px;
ma...