javascript

Returning PHP Multi-Dimension Array to Javascript/AJAX

My understanding is that in order to return a complex PHP variable to Javascript, it should be done via AJAX and json_encode. Could somebody give me an actual example (both PHP and Javascript code) of this? Lets say we have the two-dim array in PHP: $twoDArr = array( array('Greg', 44, 'Owner'), array('Joe', 23, 'Rent...

jQuery AJAX (google PageRank)

Hey guys, I need a little help.. iv'e been developing a Jqery plug-in to get the page ranks of urls on a website using XHR, The problem is when requesting the rank from google servers the page is returned no content, but if i use an inspector and get the url that was requests and go to it via my browser the pageranks are shown. so it ...

Possible to affix a DOM element to the surface of a Google V3 Map?

Is it possible to embed a CSS/HTML DOM element inside a Google map that can: Be dragged around independently of the map; 'Stick' to the map if the map itself is moved around; Overflow hidden beyond the bounds of the map. Here's a screenshot to illustrate.. ...

How does one target all divs of any webpage but differentiate them in javascript?

So I am trying to create an extension in Chrome (a prototype for a project that I am doing) that targets all of the <div> tags of any web page, hides them or rather doesn't display them until the user clicks the mouse (further explained below). So typing a url into the browser yields a white page. The person clicks, and the first <div>...

Printing to different printers using mozilla.

I am currently creating a web application that will be deployed in an intranet environment. I chose firefox to be the browser that will run it. However, in the application I am building, I need to be able to print to different printers quickly since they use different paper size depending on what client is coming. To avoid many time-was...

Split Panel using javascript

Hi All, I'm trying to code a split panel, Left and right. Each will have a button which you can click on and it will toggle that panel, while expanding the other. I am clueless as to where to start off? Is there an example that already does this? Can someone help me out. Thanks ...

DIV with text over an image on hover.

OKay first off this is really really similiar to the http://dribbble.com homepage. In the simplest form possible. I have an image, and i'm trying to CSS it so that when i hover over the image, a DIV shows up with some text and a partially transparent background color. I have no idea how to do this.. ...

How to make Gmail like loading progress bar

I want create a loading progress bar like Gmail in center and top of the page, and work in all browsers ...

Bar that pops up and down like kettlenyc.com and vevo.com

Anyone know how to create a bar that pops up and down like kettlenyc.com and vevo.com? I'm guessing some combination of css and javascript but I haven't been able to find a tutorial to help me out. Thanks ...

Javascript Sandbox

I want to have developers write some custom apps for a site in Javascript but I want to sandbox it so they can't do anything naughty like redirect the user, set the body display to none etc etc. I have a namespace in Javascript where all the functions they'll ever need exist in there so I was thinking to create a sandbox would be a matte...

Make a div with fixed position

how to make a div with fixed position at top Of the page that work in all browsers like IE ...

Is there a way to get all text from the rendered page with JS?

Is there an (unobtrusive, to the user) way to get all the text in a page with Javascript? I could get the HTML, parse it, remove all tags, etc, but I'm wondering if there's a way to get the text from the alread rendered page. To clarify, I don't want to grab text from a selection, I want the entire page. Thank you! ...

How to get rid of "Menu_HoverRoot(this) Object Expected" error in ASP.NET application (SharePoint 2007)

I have just deployed my ASP.NET/C# code to a sharepoint server and am getting this error when hoving over the menu: Menu_HoverRoot(this) Object Expected I have absolutely no idea what is causing it, but have seen other people with this problem, and it seems to be something with WebResource.axd. Could someone help me with this? Thanks....

making clean page via page.tpl.php

I have a Drupal module creating a page via hook_menu(). I am trying to make it so the page has no extraneous html output, only what I want. You can view the page here, http://www.thomashansen.me/chat/thomas. If you look at the source, you can see a strange script tag at the end. My page-chat.tpl.php looks like this, <?php // $Id$ ?> <...

unfocus selectbox

after page load, the first selectbox will be auto-focus. how to use jquery to unfocus the selectbox after page finished loading ...

Are there any drawbacks to class-based Javascript injection?

A phenomena I'm seeing more and more of is Javascript code that is tied to a particular element on a particular page, rather than being tied to kinds of elements or UI patterns. For example, say we had a couple of animated menus on a page: <ul id="top-navigation"> ... </ul> <!-- ... --> <ul id="product-list"> ... </ul> Thes...

How to stop horizontal scrolling?

Hi all, I have written a file using html and javascript. In that Vertical scrolling should be there, but i want to stop horizontal scrolling. How can I do that? ...

VSDoc alternative?

VSDoc is an awesome way of commenting Javascript, and I particularly like the ability to make one Javascript file 'depend' on another. This paves the way for Javascript minifiers/combiners that take into account proper ordering of script includes. The only thing that might bother some is that it's VS-Doc. Are there any competing format...

When page loads display 1st image text - hide all other text

Hi I have created http://techavid.com/design/test3.html and when you load the page you see there are 3 images. The sun image is focused(in color), while the others are greyed out until clicked. That is how it should be for the images. Also when you load the page you see under each image it's own text(i.e. 1st: Sun, 2nd: Airplane, 3rd: ...

SyntaxHighlighter (javascript) problem with <del>

Hi, I am using syntaxhighlighter (http://alexgorbatchev.com/wiki/SyntaxHighlighter) with a php source code with the ins and del tag. What I would like to do is to have syntaxhighligher ignore those html tags so that they can be parsed correctly. So I'd like to to display: test instead of the default <del>test</del> Anyone has ...