javascript

How to read the width and the height of a flash file in C# or JS?

Hi all, What will i do to read the width and the height of a flash file (*.swf) in C# or JS? I tried a solution in CodeProject.com but return value of height is incorrect. ...

test if content is already published on users wall in facebook

Hi, im trying to automatically publish a post on the logged in users wall in facebook in my canvas (iframe) application. the only way to do this, is by using oauth via php i think? i see no way to do this automatically via the new js-sdk. so before i publish this post, i want to check, if i have already posted this content on his/her w...

Get HTML area tag name from Javascript?

I would like to display area tag name after a person clicks on it. Unfortunately when I use code below for map area I get undefined name of obiekt name. It's weird because for textbox 'kot' it works well. <script> function metoda(obiekt) { alert(obiekt.name); //Here I get undefined! } </script> <input type='text' value='kot' nam...

javascript setAttribute

I am using javascript setAttribute for following to change 'lorem ipsum' to 'coming' in the following manner : <span id="pop_title" name="pop_title" class="title01_mc10401 ff_1 fs_10 fc22 fsb">lorem ipsum</span> Script: function modifyDOM(){ var elem_pop = document.getElementById("pop_title"); elem_pop.setAttribute("value","comin...

Array unique values

Hi Everyone, While dealing with JSON returned from YQL, I found myself looking for a way extract all unique values from an array. function uniqueArrayValues(o){ var items = o.query.results.row, output = []; function check(val){ for(var c=0; c<output.length; c++){ if(output[c] === val){ return fals...

Inserting text at cursor in a textarea, with Javascript

I've had a look round the web for solutions, and there are some, but they all seem to split code into supporting IE and Firefox. I was wondering if there's a more elegant way which would work on every browser, to insert some text at the cursor in a textarea. Thanks very much, Rich ...

Stop iPhone loading compressed images

When I view a JPEG image on my iPhone, it apparently load a compressed version of the image (pressumably to save network bandwidth). It has heavy artefacting and makes much of the text on the jpeg unreadable. I know the answer to this question is probably no, but is there any way to force it to load the original image served by the web...

javascript, html document.write

I'm trying to write a javascript using document.write but for some reasons it doesn't work . I also need to make a kind of trick to 'obfuscate' the url and "src" attribute by automated bots .Any idea why ? <script type="text/javascript"> document.write("<scr\" + \"ipt type=\"text\/jav\" + \"ascript\" s\" + \"rc=\"http:\/\/www.a\" + \"u...

calling javascript function from inside label text's hyperlink

i need to call the javascript function make_session hen the hyperlink inside the label's text is clicked upon. this is the code is used: Label1.Text += "<br><a href='next1.aspx' onclick='make_session(fi.Name)'" + ">" + fi.Name + "</a>"; y isnt ths working? there is no syntax error but the javascript function make_session never gets c...

How can I return javascript from a Ruby on Rails helper method?

I have a Note model, which can contain have either an image link attachment (linktype = "image" or some text (linktype = "text). When I display the notes, the method of display changes depending on the linktype. An example is: <% @notes.each do |q| %> <h2 class="title"><%= q.name %></h2> <% if q.linktype == "other"%> <sc...

calling other cakephp file in our page ?

Hi, Currently i am working on div based remote page calling method means i have to call another file in my div actually i have 1 buttons as button when i clicked on that it has url for replacing currently opened page by another . I am working on cakephp and in localhost i have simple iframe.html in htdocs and song folder(in cakephp) ...

Tracking Offsite Conversions with Google Analytics

I'm trying to track my AdWords campaigns through to the final conversion. However, the conversion happens offsite, in a separate session. Many of the conversions are being attributed to that external site, where in reality, the referrer was really the AdWords campaign. Currently, Analytics is properly catching only about 60% of the conve...

QTP: JavaScript synchronization

There is a frame which content is loaded by a javascript. <iframe ... onload="pageLoaded();"> A QTP test needs to wait until it finishes loading. The frame content can differ basing on user settings, so checking for existense of an element in the frame is not an option. Is there a way to wait in QTP until all content is loaded withou...

Javascript/ASP - Not working

I must be looking wrong on this but I can't find the trick: <asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent"> <script src="http://code.jquery.com/jquery-1.4.2.min.js" type="text/javascript"></script> <script src="http://www.listinventory.com/js/jquery-ui-1.8.1.custom.min.js" type="text/java...

what is means of this code in javascript

var sb = document.getElementById("top_search_box"); var val = sb.value; if(!val) val = ""; val = val.replace(/^[ ]+/g, "").replace(/[ ]+$/g, ""); if(val == "" || val=="Search for Items") { sb.focus(); return false; } return true; ...

JavaScript not beign executed due to parent div being hidden on page load?

Hi, I'm using the jQuery GalleryView plugin. I've use the plugin on one page and contained it in a div with the appropriate code which sends the div's id to the external GalleryView .js file. I'm also using jQuery to hide the div on document ready, so the users can toggle the visibility, but for some reason when the div is hidden innit...

Javascript variables not propogating through

Hi, I'm using OpenLayers with Waze (Maps layers) and having some problems with variables not propogating. I've got this code: var lonlat = new Array(), infodiv = new Array(); for (var i = 0; i < stations.length; i++) { if (i == 0) icon_temp = icon; ...

ASP.Net MVC - Send Javascript Associative array to a controller

I'm trying to pass a javascript associative array to a controller. I can pass normal arrays into a controller with this: public JsonResult ProductsByFacets(List<string> facets) but this won't work with associative arrays ...

onBeforeUnload - how to call a server-side function without ajax

Hello Folks, What I want to do: dispose of a session upon detecting an "OnBeforeUnload" event in the client. I know it doesn't fire 100% of times (90% accuracy works fine for me) Here I saw how to do it with ajax, this system, however, breaks down with ajax: I can't use it at all. I'm searching for ways of doing it ...

Does it matter where JavaScript is placed on a html page?

I've messing about with html5, I've never really had a good look at JavaScript before. I'm referencing script file like this (not in the head) <script src="somthing.js"></script> However the script only seems to work if it placed below certain elements on the page. Are there particular situations when it matters where javascript is ...