javascript

Show div from another website

Is there a way to use an iframe or some other method of showing a named div from another website? I want to pull in some data from a government website into a google map and when they click the point I want the information from one of the divs on that page to display. ...

Callback for When jqGrid Finishes Reloading?

Hi, I am using the jqGrid plug-in and at one point I need to refresh the grid and set the selected row to match the record that I am showing in detail on another section of the page. I have the following code but it does not work: $("#AllActions").trigger("reloadGrid").setSelection(selectedRow); The selectedRow parameter comes from an...

Safari openwindow function behavior on iPad versus iPhone

An identical javascript:openwindow call with a link to Google maps opens in Safari on the iPad but in the Google Maps App on the iPhone. Why the difference? <html> <head> </head> <body> <a title="View an area map for this property" href="javascript:openwindow ('http://maps.google.com/maps?f=q&amp;source=s_q&amp;hl=en&amp;geocode=&amp;...

jQuery UI, setting two handles calling only one function

I'm having a bit of trouble using the slider in the jQuery UI API. I'm using a slider that has two handles, and I want to change them both manually. I would go about doing this in two steps, one for each handle; $('#slider-range').slider('values', 0, 1000); $('#slider-range').slider('values', 1, 2000); The problem with this is that e...

exclude javascript code from print function

I have a print function on a page in my website. the problem is, when it hits this line: <script type="text/javascript" src="http://cdn.powerreviews.com/repos/12564/pr/pwr/engine/js/full.js"&gt;&lt;/script&gt;, it tries to load it, and just never finishes. Any ideas on how to get around that? ...

Javascript: I can get the text of a selection, now how do I get the text outside the selection?

I have a bit of code that returns the text of a selection and I can assign that string to a variable, but now all I need are two variables, one for the text before the selection and one for the text after the selection. Here is the code for getting the selection: function findSelection(){ //returns the selection object. var userSele...

javascript scope problem when lambda function refers to a variable in enclosing loop

First question on stackoverflow :) Hope I won't embarrass myself... I have a javascript function that loads a list of albums and then it creates a list item for each album. The list item should be clickable, so I call jQuery's click() with a function that does stuff. I do this in a loop. My problem is that all items seem to get the same...

asp.net 4.0 webforms - how to keep ContentPlaceHolder1_ out of client id's in a simple way?

I'm attempting to introduce master pages to an existing webforms site that's avoided using them because of client id mangling in the past (and me not wanting to deal with the mangling and doing <% foo.ClientID %> everywhere :) GOAL: use 'static' id values (whatever is in the server control's id attribute) except for data-bound / repeati...

How to fetch number of the text?

I have the text like "It's the 145 of 13221 items". I need to fetch all the number("145 and 13221") of text on one time. I want to use regex to do this. What is the regex like? "\d+" is not work fine. ...

jQuery: Trouble with draggable across cloned elements

I'm trying to implement: User drags a draggable li to a droppable li. The original li is no longer draggable A new li is cloned from the original li, and is appended to the droppable li. I can't get it to work. function moveToTerm(original_course, helper, term) { var cloned_course = original_course.clone(true); original_course.a...

Filter records based on Date Range + ASP.NET + Regex + Javascript

Hi I need to filter data based on a date range. My table has a field Process date. I need to filter the records and display those in the range FromDate to ToDate. How do I write a function in VB.NET which can help me filter the data. Am I on the right track?? ...

Documentation for Twitter API using OAuth for C++

So i am upgrading our service to go to the new OAuth security measures. Using a single twitter account to send Direct Messages to users for an alert. I wrote up a quick app that retrieved the access token and secret using the Java library. But the kicker is that i need to send these messages via C++. and a Javascript file. (this is curre...

Is it possible to reference object within the same object?

I've been messing around with jQuery plugin code and I'm trying to put all of my common variables into a single object for easy access. I have included a few examples below on how I've done this, but I'm wondering how others deal with this problem. Lets say I have this var x = function(options){ var defaults = { ulist : $('ul#list...

Divs don't toggle

I have following divs on my page <div id="rpttimeline">div 1</div> <div id="rptareaview">div 2</div> <div id="rptgalleria">div 3</div> <div id="rptremainingwork">div 4</div> <div id="rptremainingspec">div 5</div> <div id="rptremainingreq">div 6</div> <div id="rptremaininguserstory">div 7</div> Initially through css I have the f...

Scriptaculous Autocomplete to activate when the page is loaded.

Is there a way to fire up Scriptaculous's Autocomplete to search with the default word from the inputfield when the page is loaded? Something like this? <input type="text" id="autocomplete" class="autocomplete_input" name="autocomplete_parameter" value="friends"/> <span id="indicator1" style="display: none"> loading </span> <div id="au...

PHP/Javascript: Restart Form Button Isn't Working, Code Insde

Basically I want a confirmation box to pop up when they click the button asking if they sure they want to restart, if yes, then it destroys session and takes them to the first page. Heres what i got... echo "<form id=\"form\" name=\"form\" method=\"post\" action=\"nextpage.php\">\n"; echo " <input type=\"button\" name='restart' value='...

iFrame Access Problem

Hi Guys, I have data in a iframe. When a user performs an action - I want this want this data to be collated and sent "inside" another iframe inside this iframe. I have having a bit trouble achieving this and was wondering whether its possible and if it is, how I can do it ? Thx ...

JavaScript date comparisons

I am new to the lower level useful functions of JavaScript, and I find myself needing to compare two date objects, but within an hourly range. For example, if Date1 is less then two hours until (or from) Date2. How could this be done? ...

Where is the documentation for the built-in JavaScript function toString?

I was looking through the jQuery code and found that isArray is implemented using the built-in function toString. I cannot find the documentation for this function on MDC. Does the doc exist? What does this function do? isArray: function( obj ) { return toString.call(obj) === "[object Array]"; }, ...

Choosing a plotting library for web/browser application

Hello, I am looking for a plotting/graphing library (mostly to do line plots) for my application. I have been looking at JavaScript APIs (like Google's) but I found them to be slowing down things at client side (I am plotting a quite large number of points). I also found that with client-side libraries, the performance was quite varied ...