javascript

How do I parse TinyMce article content to find embedded images using JS

Hi all, I want to parse the content that is written in the TinyMCE editor in the client side I want to get all the src attribute values of the images that are inserted in the editor editing area(in the article body)and store them in an array. How can I do that ? Thanks (I tried: var arr = new Array(); $(".txtEditorClass img").ea...

Asyncronus javascript rendering widgets

Hey all, I'm creating a javascript widget so third partys (web designers) can post a link on their website and it will render the widget on their site. Currently, I'm doing this with just a script link tag: <div class="some_random_div_in_html_body"> <script type='text/javascript' src='http://remotehost.com/link/to/widget.js'&gt;&lt;...

Implementing prompts in text-input

Hi, I have a form with some text-inputs: login, password. If user sees this form the first time, input-texts should "contain" prompts, like "enter login", "enter password". If user clicks text-input, it's prompt should disappear to allow typing. I have seen various examples, that uses background image with prerendered text on it. Tho...

Iframe loaded in javascript

I dynamically am changing the location and src of an iframe. Is there an event that will tell me when the page i just put has loaded from javascript? Basically I want to append something to the page but first need to know that everything is loaded. ...

Adding link to a label ASP.NET (VB)

Hello, I have a label and I want to add to it a link. I want to use javascript like : MyLabel.Attributes.Add("`onclick`", "javascript:`SOME_CODE`") What must I add in (SOME_CODE) to redirect the user to another link. Thanks. ...

What is the mechanism/algorithm involved in functions that perform a fade of some sort?

What is the mechanism/algorithm involved in functions that perform a fade of some sort? What are some links or resources i can check out when it comes to this matter. ...

Building an analytics dashboard in Rails

I'm looking to build a Rails app to do internal reporting (make charts or general data visualizations, create reports, show statistical analyses, etc.) on data my company collects. What would be helpful in building this? For example, any Rails/Javascript libraries I should be familiar with, or any open source analytics apps or existing ...

Where is a good javascript reference for object event handlers?

I am relatively new to Javascript and constantly need to look up how to handle various events for objects. For example, I have a table containing a few text fields and need to know when somebody starts typing in any of the text boxes. Is there any good concise reference on the web anyplace that documents all of the objects and event ha...

Javascript if/else statement in iframe

So I'm trying to use javascript to pop up a video, and need to know when I'm in an iframe so I can resize the video accordingly. When outside the iframe, I see three alerts ('this is seen by both', 'not in iframe', and 'this is after the fact') When in the iframe, I just see the first alert ('this is seen by both'). var handleViewVide...

Append an onClick event to an anchor tag using jquery?

I am trying to add an onClick event to an anchor tag ... Previously i had ... <a href="somlink.html" onClick="pageTracker._link(this.href); return false;"> But i am trying to avoid the inline onClick event because it interferes with another script.. So using jQuery i am trying the following code ... <script> $(document).ready(fu...

Local variable vs parameter

function doIt(param) { var localVar = param; //do lots of stuff with localVar } function doIt(param) { //do lots of stuff with param } Is there any difference in terms of efficiency between the code above? ...

See if certain text is in URL and if so print something dynamically via javascript..

Hello - Here is what I would like to ideally do within my HTML - I would like to insert a bit of javascript that checks to see if a certain directory name is listed in the current user's URL and if so, output copy on the page. For example: If the current URL has the word "trigger" in it such as: http://www.mysite.com/pages/trigger/d...

How to do this in a smart way

Hello SO. My websystem im coding with now is integrated from the originally phpBB system. With this i mean when you log on my websystem, you have actually logged into the forum from the login page. Now i came to the "log out" part, and i want to make it smart. Right now its a simply link with logout: <a href="<?php echo BASEDIR; ?>../....

Checking is near/at the bottom of the page

I need to check if an element is x pixels from the bottom of the page, to dynamically load new content. currently, scrollTop and height do not match even if the bar is on the bottom. jquery is allowed, although basic javascript would be more helpful. ...

Need help on Coda slider tabs to move inside an overflow:hidden div

I'm not too good at javascript. and hope I can get a bit of help. I'm using Coda Slider 2.0, and have designed it to where the tabs are another slider to the right of the main slider, and each item. Basically like this mootools plugin http://landofcoder.com/demo/mootool/lofslidernews/index2.1.html Problem is the items will not scroll. H...

javascript - query object graph?

Given an object like this: var obj = { first:{ second:{ third:'hi there' } } }; And a key like this "first.second.third" How can I get the value of the nested object "hi there"? I think maybe the Array.reduce function could help, but not sure. ...

how to use alert in php and js combined

have a need to alert through php, I have the code below. Problem is that it works as long as I dont use header redirect. But as soon as I use it..I loose alert. echo "I will do some functions here in php"; if($value == 1){ alert('ok working'); } header(location: 'someOtherpagethanthis.php'); ...

PHP or Javascript or other - Draw simple shapes onto images?

I basically have an image of a world map and i would like to place a pin image at a specified pixel co-ordinate ontop of this world map image. It's for a website, so ideally the solution should be in PHP or Javascript (i'm avoiding Java and Flash as i want it to be as simple as possible). I had a look at the processing.js library but i...

Is the JavaScript RegExp implicit method deprecated?

So everyone knows what I mean by "implicit methods"? They're like those default properties from the Windows COM days of yore, where you could type something like val = obj(arguments) and it would be interpreted as val = obj.defaultMethod(arguments) I just found out JavaScript has the same thing: the default method of a RegExp obje...

How to change background-image css property w/jquery

How can I set the background-image css property of say a div using jquery? will something like this work? $("#div").css("backgroundImage", "url('test.jpg')"); ...