javascript

Jquery UI dialog + modify all href on open of the dialog

I got this Dilaog that is openning perfectly fine... the idea is to add a tag ?box=true to all a href of my page so when the user click and change page the dialog reopen if the user close the dialog it sets the ?box=false $(function() { $('#prebox').click(function(e) { e.preventDefault(); var $this = $(this); var horizontalPa...

Multi-line string insert using jQuery

$("#addSelect").click(function() { $("#optionsForm").after("Hello world."); } ); This works. $("#addSelect").click(function() { $("#optionsForm").after("<tr> <td><input type="text" class="optionField" value="Options" /></td> <td> <ul class="option"> <li><select><option>Value..</option></sele...

Create a web based GPS Skyplot

I am looking to create a web based GPS skyplot. Currently just in the planning stages. Was wondering if anyone knew any javascript libraries or such in which this would be best to start with or have a look at, of if you have done something similar before. I know Flot is decent for plotting but unsure if it would be easy in this scenario...

Why is this DIV rendering with no dimensions?

http://clifgriffin.com/blockade2/ Ok, I have an unordered list that serves as a list of menu links. In each li there is a div that is set to absolute positioning, bottom: 0. The idea is you hover over the link in the li and jQuery animates the height to show the hidden menu div. It's a simple concept, but I am apparently a retard. The...

Changing background with jQuery getting stuck or can't update img's src attribute

I've spent a few hours now trying to figure this one. I've got a store display that cycles through properties and I've knocked up a simple gallery sort of script. For the last week it has worked beautifully. I went in today to tinker some unrelated JavaScript (but on the same page) and now there is an issue. To make the images fade to...

JQuery process cloned objects

Hi again folks, Quick question please. How do you process JQuery clones objects? Simple example: <div class="hello"> <select name="products[]"> <?php foreach ($pageposts as $post): <option value="'.$post->ID.'">'.$post->post_title.'</option> endforeach;?> </select> <input type="text" name="try[]"> <br/> </div> <form> <div id="goodbye...

How to distinguish Unload Event triggered by Refresh or Window Close?

Unload Event can be triggered both by Refresh action and Window Close action. is there a way to distinguish which action that actually trigger it? In my situation, i want to ignore the Refresh action. Could you please give me some insight what the work around is? I noticed that there is already this sort of question asked, but it seems ...

Make a html element appear clickable with JQuery / JS

Is it possible to make an html element appear clickable with JQuery? By appear clickable I mean have the mouse pointer change appearance when the user hovers over the the element. I dont want to use a tag. ...

Having issues with JavaScript AutoComplete

Hi all, I am trying to get AutoComplete to work on a website application I am making. I have stripped my code down to the bare essentials and I still cannot get it to work. I got the source file from http://www.phpguru.org/static/AutoComplete.html and I have done my best to implement it exactly how they did on their website demo. My t...

how to check javascript array equals ?

var a=[1,2,3]; var b=[3,2,1]; var c=new Array(1,2,3); alert(a==b+"|"+b==c); demo how to check these array, and get true from equals method? under jquery, has any methods for this? thank you :) ...

how to call remote page in div ?

Hi this is my code for taking external page into div using ajax what i tried is i clicked on button i must display the response in div but i tried several times but doesn't works. my javascript code is var rootdomain="http://"+window.location.hostname function ajaxinclude(url) { var url=rootdomain+url; alert(url); var page_re...

How to iterate over an array of objects in JavaScript?

I'm using PHP to fetch "tasks" from my database and encoding it as JSON. When I transfer the data over to javascript, I end up with something like this: Array { [0] => Task { id: 2, name: 'Random Task', completed: 0 } [1] => Task { id: 8, name: 'Another task', completed: 1 } } etc. I gu...

How can i access javascript variables in JSP ?

I want to access Javascript variables in JSP code. How can I do that? ...

using jquery to make ajax call and update element on form submit

Here is my html form <div id=create> <form action=index.php method=get id=createform> <input type=text name=urlbox class=urlbox> <input type=submit id=createurl class=button value=go> </form> </div> <div id=box> <input type=text id=generated value="your url will appear here"> </div...

how to make table of content in jQuery

as I am beginer please tell me how I can make toc for my web page using jQuery. my page would look like this ====== sample Table of Content ==== Introduction |> What is Web |_> What is JavaScript Programming HTML5 |> Learn HTML5 |> Your First Example ...

Regular expression in javascript for restricting HTML entites like &lt;

Hii, I want to restrict the html entities like '&lt;' , "&gt;" , "&amp;"etc but it should accept '<' and '>' when i click on a button from the javascript. Can anybody gives me the regular expression for that ...

What is the difference between using var and this, in Javascript?

What is the difference between these? var a = 13; this.b = 21; document.write(a); document.write(b); ...

How do I get the Id of a hyperlink?

How do I get the id of a hyerlink on a page? Example <a id="myID123" href="myLinkPageName.aspx">myLink</a> Note: The page name and the link name is static! I should get the id "myID123". ...

Aproaches to create dynamic UI from Ajax Response ?

Very common scenario using Ajax is to parse the response and create the user interface for end user. I am still new bee to the Ajax and UI words and i only see two choices to create the UI using Ajax (JSON/XML)response , CreateElement() way and go on adding/removing elements dynamically Create big string and set innerHTML of some eleme...

on use of window.showModalDialog no buttons of parent window work

hi, i have a asp.net application and have a requirement to implement a new functinality on a existing aspx page. Let us say i have pageA.aspx, i have to add a new button to this page which will invoke a modal window pageB.aspx. I have added a new HTML input button ("show image"), and on the onClick event i call a javascript function. ...