javascript

Catch only a left clicks on links.

We are using event "click" to catch click on links and load content via ajax. But event happens also on right mouse and wheel clicks. How to process only left? confused // jquery.coyod-engine-0.5.0.js $(document).click(function(e){ var t = $(e.target); if(t.hasClass('aj')) { e.stopPropagation(); e.preventDefault();...

Wicket: how to synchronize requests within session

Scenario: Apache Wicket based web application running on Tomcat server. User opens URL in browser, session is created and simple main page is shown in browser, user clicks on button and AJAX call is invoked. Application gets request and doing some stuff preparing response. In same time user or JavaScript in browser invokes another AJAX...

adding php to javascript

How can I add php variable to javascript e.g: onClick="javascript:alert('echo $name;')Click Me</a>*** but it is not working i have not includey original becuse it is not showing original …!! ...

how to get content of nested div with jQuery

So I have a nested div structure and I would like to get the content of the second level. How should i do it with jQuery .load? The following works only with simple divs(non-nested)... .load("https://remote-site.com/blah.html #div_1", function() { } Ok, the whole stuff is: <html> <head> <title>AJAX Checker </title> <link rel="styles...

Javascript data structures

Hi, I would like to know if it is possible to do something like this: if (mb == null || typeof (mb) != "object") { var mb = new Object(); } mb = { tests: { onAnimals: { test: function() { return ""; } } onHumans: { test: function() { r...

Javascript eval results in "undefined function" but works in Firebug

I'm wondering why when I call: eval("myFunc(1,2,3)") in the Firebug console on a rendered page, the function executes properly, but when I call the same eval within by javascript within then page, I get a " is not defined" error that pops up in the Firebug console. Part of my problem is that I don't have control over the incoming HTML/...

javascript set interval session management

Gentlemen, I am in the midst of working on a project that is session-based. I was thinking that similar to a bank, I'd create a check and offer users the ability to thwart a session time-out. I was thinking about creating a setInterval that would check a blank page that requires auth. If the timer is getting close to end-times, it'd th...

Save chart image with open flash chart2

I am using Open Flash Chart 2 to create some graphs. I want to be able to save an image of the graph, which OFC2 supplies some methods to accomplish this. I used the example on the OFC2 site to directly display the raw image data on the page, but that does not work in IE6, which most of our users are using (I know, I know). I switched...

Online Image Editor - Ajax or Flex / Flash??

I am working on a plan to build an online image editor with just some basic functions. It should (obviously) contain a canvas working area and support the following functions: 1. Upload an image from your computer or submit a link 2. Resize image (by dragging the corner) 3. Rotate and flip 4. Drag / move / pan 5. Layering (if more then ...

Find the "potential" width of a hidden element

HI all, I'm currently extending the lavalamp plugin to work on dropdown menus but I've encountered a small problem. I need to know the offsetWidth of an element that is hidden. Now clearly this question makes no sense, rather what I'm looking for is the offsetWidth of the element were it not hidden. Is the solution to show it, grab the...

ASP.NET DropDown SelectedIndexChanged not firing in Firefox with UpdatePanel

I have an asp:Updatepanel that contains a dropdown and I run some Javascript on the onchange event of the dropdown. I also fire some server side code on the selectedindexchanged of the dropdown. This works OK in IE, but in Firefox the selectedindexchanged event never gets called. I think this may be something todo with onchange and ...

Detecting tab visibility in Firefox

I'm writing a webapp that performs an action every minute or so which (very briefly) hangs the browser. I'd like to pause this action when the tab displaying the webapp is not shown, to minimize the annoyance. Is there any way to do this using Javascript, under the latest version of Firefox? Edit: to clarify, I'm asking about how to det...

jQuery fadeIn/fadeOut in IE mess the layout

Hi, I have a div which contains multi-columns layout and when I click on a button I want that this div fade out and then clicking on an another button this block would fade in. Simple and it works perfectly on firefox. However when I fade it out inside IE the layout of my columns is modified. It is as if my columns are transformed in n...

Google Maps: Event Listener only remembering final value of variable

I'm putting together a Google Map which contains the locations of various test centres around my country. It plots a marker on each county, and when you click the county marker, it zooms in and gives an overview of the test centres in that county. I'm also using jQuery with this. Here's the problem: When I plot the county markers and c...

ASP.NET AJAX: Creating a postback

I would like to cause a post back that occurs only once by inserting some AJAX into the page after a specific event occurs. Currently I have: string script = "<script language='Javascript'>" + "__doPostBack('GetSpreadsheet', '');" + "</script>"; Page.ClientScript.Regi...

Sending click event to parent anchor

How do I send a click event (JS or JQuery) to a parent object that is an anchor? My basic HTML looks like: <a href="javascript:myFunc(1,2,3)"> <img id="btn1" src="myimg.png"> </a> So I can easily reference the anchor through button via: document.getElementById('btn1').parentNode However, document.getElementById('btn1').parent...

New line in JavaScript alert box

How do you put in a new line into a JavaScript alert box? ...

Including Information in HTML for Javascript to Consume?

Hi everyone I'm am building a web app with app engine (java) and GWT, although I think my problem is moreso a general javascript question. In my application, I want to include a side-menu which is generated from data in my database. This obviously needs to be done dynamically from a servlet. Currently, I am sending a blank menu c...

how to do something like google-analytics

hi, I need to make something like google-analytics, I mean that it has to be very simple to install and enables a comunication between 2 websites. Let me explain the idea. I'm developping an application (with ZF) where my clients will be online shops, OSCommerce only at the begining. Those shops need to get some info from my app's datab...

JQuery UI draggable not working at all!

Why does this not work at all for me? <script type="text/javascript" src="Javascript/jquery-ui-1.7.2.custom.min.js"></script> <script type="text/javascript" src="Javascript/jquery-1.3.2.min.js"></script> <script type="text/javascript"> $(function() { $('.selector').draggable({ axis: 'x' }); }); </script> <body...