javascript

How can I get jQuery to ignore parents on .click()

Sample code: <div id="a"> <div id="b"> Click here </div> </div> <script> $('*').click(function() { alert($(this).attr('id')); }); </script> When you click 'Click Here' it alerts twice, once with 'b' and then with 'a'. I need to figure out how to get jQuery to ignore all the par...

How to open facebook connect login window?

In the new Facebook Connect JS SDK, you'd call FB.login(). How would you achieve the same thing with the old SDK? Thanks! ...

Select all based on category

function Check(chk) { if(document.myform.brandid.value!="Check all"){ for (i = 0; i < chk.length; i++) chk[i].checked = true ; document.myform.brandid.value="UnCheck all"; }else{ for (i = 0; i < chk.length; i++) chk[i].checked = false ; document...

uncaught exception: [CKEDITOR.editor] The instance already exists

I've included the CKEditor on my site. Everything works even though I get this JS error: uncaught exception: [CKEDITOR.editor] The instance "simple_editor" already exists. The code below is contained inside a PHP file which I include where ever I want the editor. I only have one instance of the editor per page. <textarea class='ckedit...

make sum of counts of item descendants in jQuery

Hi I have the following code <ul id="sample-menu-1" class="sf-menu"> <li class="current"><a href="#a">main item <span class="cntnews">0</span></a> <ul> <li><a href="#ab">sub item 1 <span class="cntnews">0</span></a> <ul> <li><a href="#">menu item <span class="cntnews">4</span><...

How to animate text using JavaScript

Hi I want to implement animated text i.e. moving the text from bottom (half of the page) to the top like marquee. I don't get any good code. Does any one know how this is implemented in JavaScript or jQuery or DHTML? Thanks in advance ...

Javascript slide element

I want to know what's the best technique to slide an element just like in these examples: http://demos.flesler.com/jquery/localScroll/#section1c But with Pure Javascript so NOT jQuery or any library. Example structure <div id="holder"> <div id="bridge" onclick="slide('content')">Click to slide</div> <div id="content" sty...

Asp.Net button onclientclick problem

Hello, I have a strange problem, it seems, that I don't know how to solve. I have a button like this: <asp:Button ID="btnSave" runat="server" ClientIDMode="Static" Text="Save" OnClientClick="return ConfirmSave();" OnClick="btnSave_Click" /> If I write my client function like the following, it works as expected: function ConfirmSave()...

Extract string between start string and end string using javascript

Hi all, Consider the following snippet of code: <div align="Left"> <font style='font-size:17pt; font-family:Times New Roman;color:#000000;'> <textformat tabstops="[20]" leftmargin="0">Hi all</textformat> </font> </div> I want to extract string between "font-size" and "pt" i.e it should out me a decimal "17" using javascript. Can thi...

How to get resultant HTML after executing all scripts?

How to get effective HTML after executing all scripts? Actually scripts are adding and modifying control and css in the page. I would like to see html of resultant display as a static page. Is there any way to get this? Edit: Suppose if background image is added using javascript, How can i see in Html OR css? Please try to get this befo...

How to implement stackoverflow's "related questions" feature using jquery?

With Stackoverflow's "Ask Question" feature, when I've finished typing the title of the question I'm asking, the area beneath the title would open up and display a list of "related questions." How do I implement that using jquery/javascript? Is there any plugins or open source code I could use for that? I'm building a site using Django...

Jquery calculate position of div after animation

Hey i have a div moving via a jquery animation and i am trying to calculate that divs position. The position is calculated on click but then the position before the animation is calculated and not after the animation. Sooo basically how would i go about having the animation happen and then have the position calculated and make the appro...

JavaScript and getElementById

How can I get a collection of elements by specifying their id attribute? I want to get the name of all the tags which has same id in the html. I want to use ONLY getElementById() to get an array of elements. How can I do this? ...

A slide right and left effect

Hi, I have a the following html code : <div class="menuTabs"> <div class="mtabArrowLeft">Left</div> <input class="menutabBTN" name="" type="button" value="a" /> <input class="menutabBTN" name="" type="button" value="b" /> <input class="menutabBTN" name="" type="button" value="c" /> <input class="men...

jQuery/JavaScript: Why does this freeze?

I'm trying to implement a requirement that requires I set a maximum line length for the contents of a div element. But when I open the page in Firefox, I get an error about a "long-running script" and am asked to Continue, Debug, or Stop Script. I don't understand why this is happening. This is my code: <html> <head> <sc...

how can i add a js code to my iphone app in xcode

hi, i want to use a chart in my iphone app. i find pretty good charts written in javascript. but i couldn't find out how to add and use it in my app? by the way, itried google chart apis but needs internet. and i tried core-plot but didn't like much :(. i want to use javascript in my app... thanks in advance... ...

scrolling a text with in a column

Hi I have a web site. In this i want to scroll a text from bottom to up direction.this column also contain a scroll with up and down arrow. with the same functionality of scroll bar. simple my objective is there is a scrolling text with in a column ...

what are the issues javascript eval can pose

i tried googling but didnt get a very specific answer.. then again, i might be not using the right keywords.. can someone point out the "security" issues javascript eval can cause? with examples with be very nice. will also do if you can point to an existing web resource which does the same. Edit: I only need the security implications f...

Onclick change value, jquery how?

I have a list of videos - On each video there is an onlick function - the onlick function should replace the value(URL) of the : <object width="640" height="385"> <param name="movie" value="http://www.youtube.com/v/QmOkhayXlYw?fs=1&amp;amp;hl=da_DK"&gt;&lt;/param&gt; <param name="allowFullScreen" value="true"></param> <para...

highlight selection through javascript

i want to highlight the selection.I have gone through this solution suggested by Tim Down , which does the half job for me. http://stackoverflow.com/questions/2582831/highlight-the-text-of-the-dom-range-element I have web pages stored at local,now i need a way to highlight the text permanently.By permanently,i mean i highlighted some tex...