javascript

How to center align pop up div using Javascript

How to align a pop up division to center of monitor/screen using javascript? I tried using screen.width and screen.height to get center. But the division gets aligned to center of scrolling page vertically Thanks in advance for any help and suggestions ...

JavaScript dependency management

Hi all I am currently maintaining a large number of JS files and the dependency issue is growing over my head. Right now I have each function in a separate file and I manually maintain a database to work out the dependencies between functions. This I would like to automate. For instance if I have the function f Array.prototype.f = fun...

How do I stop a textarea from scrolling to the top whenever I change its value

I'm making something where a textarea gets more and more text appended. In firefox, the textarea scroll back up to the top each time. I currently have something like textarea.scrollTop=1000000; to scroll it back down each time it changes, but it still goes up to the top for a very short time. Is there any way to stop it doing so? ...

Change image by current time

I have two images. I want to display one image if its day and another if it night. This should be done using javascript. For example display one image from 8:00 to 00:00 and another from 00:00 to 8:00. Is that possible using javascript? ...

How to intercept every AJAX request from a webpage

I need the way to intercept all ajax requests maded from page. So i need some wrapper to add my data to all users requests. ...

Will cross-domain scripting using JavaScript work when the two frames have the same domain 2 levels up?

I have a scenario, in which a .net application is hosted from SAP portal. SAP portal domain: portalURL.al.xx.company.com App server domain: AppURL.ss.xx.company.com As you can notice the portal and the app server domains are not same 1 level up.(i.e. at 1 level up, portal domain will be al.xx.company.com & app server will be ss.xx.co...

Calling a PHP page with MySQL query from Javascript function then returning results to another javascript function

I am refactoring some code. I have a PHP page that contains a MySQL query and stores the result in a PHP variable $my_result. This result is then echoed to a Flash SWF during embedding with SWFObject. I now want to call this PHP page that makes the query from a javascript function like so - one change I have made to the PHP is that ins...

How to display a blinking / flashing link in html

I am in need a link that will flash every 500 milleseconds, for a duration of 5 seconds... I remember long ago having a link like this, but deleted it because one could only click it when it was visible. Is there a workaround for that? ...

Change Google Maps polyline z-index

Hi. I'm using the Google Maps API v3 directions service to calculate a route between two points. There are a lot of markers on my map and I want the polyline of the route to overlap the markers, so that the route is always visble. How can I do that? I tried to use PolylineOptions.zIndex, but this z-index value is calculated with regards...

Selected Text Instance

I have a bunch of text on my document. You can select word/words from it and highlight the text. After you highlight it, an ajax request is sent and the selected word/words are sent to backend (PHP) and processed to be saved into the database. The page is refreshed and the selected text is permanently higlighted. Now the bad part, if yo...

how do I populate 2nd listbox by selecting from 1st listbox using jquery?

I have two questiosn. 1) I have a list box which gets populated depending on what I select in my 1st drop down. The data is retrieved using jQuery.get. The code for generating the list looks like this: (...) foreach (DataRow row in dt.Rows) { strList.Append("<option value='" + row["id"] + "'>" + row["enhetsnavn"] + "</option>"); }...

How to combine CodeMirror and http://plugins.jquery.com/project/TextAreaResizer

How can i combine the CodeMirror editor [1] with the TextAreaResizer jQuery plugin ? [1] http://marijn.haverbeke.nl/codemirror/ ...

[JQuery] JQgrid set row height

Hi, I am using JqGrid with javascript. I would set the height of each table row but I have not understand how to do. This is my code: function jobList(){ var json=doShowAll(); alert("jobList() ==> php/get_job_status.php?value="+json); jQuery("#jobList").jqGrid({ url:'php/get_job_status.php?value='+json, datatype: "xml", col...

JQuery- $(xmlObject).xml does not work in Mozilla but works in Internet Explorer

Hi All, Consider the following snippet of code: function parseXml(xml) { xmlObject= xml; alert(xmlObject.xml); } function close(errroMsg) { //Displayed Error Message } $(document).ready(function() { $.ajax( { type: "POST", url: "ServiceProvider.aspx", ...

Jquery POST with same request not work

i have next problem $("#btnsave").click(function(){ $.post('svld.php',{'fnd':$('#fnd').attr("value")},function(data){ alert(data); },'json'); } slvd.php header('Content-type: application/json'); var_dump(json_encode($_POST)); in request i see next fnd http://ya.ru and have great response string(24) "{"fnd...

How do I add custom javascript to my rails3 views?

What is the best way to add JavaScript to my Rails3 views? I would like to be able to do some processing in a controller, then craft some JavaScript based on the result and put the resulting JavaScript in a view. For example, I would like to get a series of lat/lng points from a database and create markers on a Google Map. The map i...

jQuery Cycle plugin - Automatic height for containers

Hi I'm using the cycle plugin on some divs, like this: <div class="sections"> <div class="Section"> <img /> text </div> <div class="Section"> <img /> text </div> <div class="Section"> <img /> text </div> </div> all the .section divs have variable height, based on their contents. How can I make cycle not to resize the container ...

Accessing the content of other tabs in browser

Hi, I am using mozilla firefox and am trying to figure out a way to access the content of other tabs in the same window with the help of javascript and DOM (am open to other techniques if exist). Would someone help me? E.g. I want to run a javascript in tab1 which can find the title of some other tab. Basically I need this so that I can...

How can I get the video's image in JW Player?

How can I get the video's image to using with sendEvent(); in JW Player? For example i'm using var playerx = document.getElementById(player); playerx.sendEvent("LOAD","http://www.domain.com/videos/"+x); playerx.sendEvent("PLAY","true"); for click event for starting the videos while clicking a video's thumb in a page. I want x's thumb ...

Not able to input text in html text field

I have a script that makes me able to drag some content in a div. But because you can drag around, no matter where you place the cursor in the div, I am not able to input some text in a text field. Is it possible to allow that? I can eaily click links in the div container. But not input text in a html input field. This is the javas...