javascript

Adding HTML elements with JavaScript

So, if I have HTML like this: <div id='div'> <a>Link</a> <span>text</span> </div> How can I use JavaScript to add an HTML element where that blank line is? ...

Javascript - If drop down is selected, change image in a container.

Hey guys. I'm trying to change the image in a container with what I thought was simple javascript, but can't seem to figure it out. "cover-image" is the container where the image is, and "txtMontage" is the ID of the drop down list. If I run this as is, no mater what I select the image is set by the first if statement, and then the drop ...

jqgrid update SelectCommand at runtime and listen for row select?

1) I am using the jqgrid plugin to show results from different selections a user can make on sliders and such. The jqgrid loads via a php command: $grid->SelectCommand = 'MySQL SELECT statement here'; But I want to change this, and reload the data at runtime (via jquery) when the user makes a change. (Also if possible I would like t...

Generating/registering client-side scripts on ASP/VB.NET

I am currently in the process of converting old "Web 1.0" code to meet current standards. Is there a better way to generate and append a client-side script other than appending a plethora of lines to a StringBuilder and then registering it to the page via ClientScript.RegisterStartupScript(Me.GetType(), "startUpScript", strScript)? Is ...

javascript If statement, looking through an array

Mind has gone blank this afternoon and cant for the life of me figure out the right way to do this: if(i!="3" && i!="4" && i!="5" && i!="6" && i!="7" && i!="8" && i!="9" && i!="2" && i!="19" && i!="18" && i!="60" && i!="61" && i!="50" && i!="49" && i!="79" && i!="78" && i!="81" && i!="82" && i!="80" && i!="70" && i!="90" && i!="91" && i...

Trying to incorporate swfobject into my javascript overlay but nothing shows up

<script type="text/javascript" src="swfobject/swfobject.js"></script> <script type="text/javascript"> //<![CDATA[ function hide() { document.getElementById("overlay").style.display = "none"; } function show() { document.getElementById("overlay").style.display = "block"; swfobject.embedSWF("helpdeskApp_three.swf", "overlay...

Turn a comic strip to an iphone webapp

Hi, I am helping a friend to turn her weekly comic strip into an iphone webapp. Is there any sample app that I can learn how this is done? The comic strip is a new jpeg file every week, usually containing 4 blocks. It is desirable to show one block at a time and use swipe events to move back and forth. Any help is highly appreciated....

right click on html link which execute javascript

When i click a link, i want to execute a javascript function to get the dynamic url. So i did like below. <a href="javascript:myredirect()"> a link </a> With this code, I cannot see the default context menus provided by browsers like 'open link in new tab' or 'open link in new window' when i right click the link. I tried like below to...

Attaching events to flat ajax response html with jquery

In the application that we have, we're doing some AJAX response. Once in a while we get back a response that isn't fully contained Test 3 in the code below. While it's possible to beat people into submission, I would like to just build in some belt and suspenders in the code to handle the case. The key is the findself() function which...

javascript string split negative

Is it possible to use string split in javascript to get the last element in the array that is produced. For example, im sure in php you can do the same and use a negative limit value to get the last item i.e. -1 or the last two items -2 etc. ...

After watching an HTML5 video in fullscreen in an iPad how do you close the fullscreen?

Go to YouTube.com in Safari on an iPad and watch any video on full screen. At the end of the video the full screen will close out and bring you back to the web page. How the heck do they pull this off? ...

Prototype: Display 503 error message with Ajax.Request

I'd like to display the error message that comes back from a Prototype JS Ajax.Request call. new Ajax.Request('ajax.php?action=Set&netboot=' + $('netboot').value + '&root=', { on503: NetbootUpdated, onSuccess: NetbootUpdated }); } That is my code. I basically want to use on503 to display the content that the fi...

XPath attribute quoting in JavaScript

I am trying to build a function that will properly quote/escape an attribute in XPath. I have seen solutions posted in C# here and here, but my implementation in JavaScript results in an error "This expression is not a legal expression" Here is my function: function parseXPathAttribute(original){ let result = null; ...

jQuery, need help with 'sortreceive' ajax call and POST vars.

Hi there, I have a dilemma that just seems beyond my abilities at the moment! I have a group of connected sortables using the class 'biglist'. What I want to do is bind #biglist 's sortreceive callback (which is made whenever a list receives an element from another) to take the 'boxnum' value of the element (which signifies which list...

Multiple Clicks inside li element

Hi guys, I have the following structure : <li onclick='GetMyTopic({1});' class='SideBarBoxli SideBarBoxLiSelected' id='MyTopics{0}'> <div style='float:right; padding-top:3px;'><a href='{0}'> <span>{1}</span></a></div> <div > <a id='img{2}' onclick='DeleteTopic({0},{1})' href='#'> <img src='../../../images/delete.png' height='16' wi...

Jquery Image Slider

Hi, I have a jquery image slider, but it only shows 2 slides, so i cant really add more images than whats in those 2 slides is there any way i can create more slides here is the code /* Slideshow */ $(document).ready(function() { slideshow_loading = true; slideshow_busy = true; current_slide = 1; slideshow_l...

Online Image Slideshow using PHP, GD, XML, and Javascript

Hi, I wrote some code to automatically track many objects through an 1000+ frame image sequence. The object boundaries and centers are outputted in xml by my algorithm. I am making a website to show off my results and I would like to have a navigable slideshow with the normal play, pause, forward, rewind features. I currently have a ...

How do I check if a variable is a jquery object or plain dom element?

How do I check if a variable is a jquery object or plain dom element? ...

template is restricting my div javascript overlay

<style type="text/css"> #overlay { background-color: #ccffcc; display: none; margin-left: -400px; position: absolute; top: -250px; left: 50%; width: 800px; height: 500px; visibility: visible } #container{ color: white; background-color: #0ff; text-align: center; position: absolute; top: 50%; left: 0px; width: 100%; ove...

Create a hexadecimal colour based on a string with jQuery/JavaScript.

Hi there. Sorry if this is a vague question... I'm not really sure how to go about it so maybe someone with the wisdom can point me in the right direction :) Basically, I want to create a function that will accept any old string (will usually be a single word) and from that somehow generate a hexadecimal value between #000000 and #FFF...