javascript

Need help with the parseInt() function

How do I get the phrase number from the phrase object using the parseInt() function? I tried to create the function within the swapFE function in var phrasenum below but it did not work. I think my values are wrong. What should I put there instead? Any help would be greatly appreciated. Thanks in advance! The following is the french phra...

what is the difference between these two functions/approaches

I use only jquery for writing javascript, one thing that confuses me is these two approaches of writing functions, 1st approach vote = function (action,feedbackId,responseDiv) { alert('hi'); return feedbackId; } 2nd approach function vote(action, feedbackId,responseDiv) { alert('hi'); return feedbackId; } Can anyon...

How to save the contents of Data URI to image.

Hi, In Google Chrome the 'chrome.tabs.captureVisibleTab(integer windowId, function callback)' method will return a data URL of the JPEG encoding of the visible area of the captured tab. We want to save that content as image to hard disk without opening/passing the contents into new html page. Does anybody know how it can be done by ja...

Splitting a text using javascript

Hi I am having string called 'santhosh'. I wish to split this text as 's,a,n,t,h,o,s,h' using javascript. Is it possible? And want to save it in an array. And I wish to check whether the splitted character is string or Numeric is it possible? ...

Get browser width and hide element depending on size?

Hello. Is it possible to detect what width a browser window is and hide an element on page if its lower than 1024? In JQuery perhaps? :-) ...

Update HiddenFiled value on parent window after child window is close Javascript,VS2005 c#.

I have a child window and a parent window with a hiddenfield hdnSelectedFields .I am changing the value of hdnSelectedFields. Code: String vStrScript = "<script language=javascript>function CloseParent() {window.opener.document.getElementById('hdnSelectedFields').Value = '" + tempstring + "'; alert(window.opener.document.getElementById...

Render JavaScript and HTML in (any) Java Programm (Access rendered DOM Tree)?

Hello Experts, I know this kind of question must have been asked here before but by searching I didnt find a solution: My question is: What are the best Java libraries to "fully download any wepage and render the built in JavaScript(s) and then access the rendered webpage (that is the DOM-Tree !) programatically and get the DOM Tree as...

Get script path

In CSS, any image path is relative to the CSS file location. f.ex if I put the CSS file in /media/css/mystyles.css and use something like .background:url(../images/myimage.jpg); The browser will look for the image in /media/images/myimage.jpg which makes sense. Is it possible to do the same thing in javascript? F.ex if I include /m...

Why is onchange on a checkbox not fired when the checkbox is changed indirectly

I'm using Prototype to monitor checkboxes, so I can add javascript checks to them. When the tr or td in which the checkbox is located is clicked, the checkbox should be checked. When you click directly on a checkbox, the onchange event is fired, so you'll get an alert. When the checkbox' value is changed by javascript (when you click on ...

to display calendar using javascript and php

hi everyone, im new to this PHP im trying to develop a code such that when i click launch calendar it ll display calendar and when i choose the date it ll display in the text field but my problem is when i clik launch calendar its not showing feburay month.. i dont no wt the error in my code can anyone pls help me out in this.. thanks in...

.wrap() and multiple element selectors

What's the best way to wrap multiple elements. I've tried several methods but without success. This is the markup: <div> <h3>Civil aerospace </h3> <p>Powering more than 30 civil aircraft types from small executive jets to the lartest airliners.</p> <h4>£47.1bn</h4> <p>Order book</p> <h4>£4,481m</h4> <p>Revenue</p> </...

Content Placeholder Javascript Object Expected Error

I have the following code behind that was, until recently, working fine and dandy! tbxProdAC.Attributes.Add("onclick", "$('#" + GridView1.ClientID + "').remove(); $('#" + radProdAC.ClientID + "').attr('checked', true); $('#" + ddlBuyer.ClientID + "').val('--Choose Buyer--'); $('#" + ddlSub.ClientID + "').val('--Choose Sub Category--...

Is the HTML <base> tag also honored by scripting and CSS?

The base HTML element provides a base for relative URIs in the HTML. Must JavaScript and CSS also honor it for relative URIs issued in them e.g. JavaScript location.href = "mypage.htm" or CSS h4{ background-image: url(myimage.gif) }? Any browser. ...

Implementing Finite State Machine for Web UI

I am intending to develop a Finite State Machine in the following manner. Extract Control IDs from a --> web-page, Write control IDs to a XML --> Controls-XML. Manually declare States and Transition in the --> Controls-XML Scan Controls-XML and attach pre-declared Jscript to eventhandlers embed them in the --> web-page.. 5. How feas...

How can I get the name of function inside a JavaScript function?

Hi, How is it possible to learn the name of function I am in? The below code alerts 'Object'. But I need to know how to alert "Outer." function Outer(){ alert(typeof this); } ...

Iframe Function Calling From Iframe to parent page javscript function

I want to call a js function from iframe to a parent window <script> function abc() { alert("sss"); } </script> <iframe id=myFrame> <a onclick="abc();" href=# >Call Me </a> </iframe> ...

JSON python to javascript

I want to transfer some data from python to javascript. I use Django at python side and jQuery at javascript side. The object I serialize at python side is a dictionary. Besides simple objects like lists and variables, this dictionary contains instances of SomeClass. To serialize those instances I extendeded simplejson.JSONEncode like...

javascript returns HTML doesn't get bind properly

in my aspx page i call a javascript function, from a div tag that function generates some html which it returns. this html suppose to show an icon , instead the html which is generated gets bind to div tag. here's what i have done.. <div>{{ ifRecy(IsVal,Date)}}</div> this is my function function ifRecy(isRecy, Date) { var ...

'this' keyword refers to what object within an a function inside another function?

Hi, Basically I am trying to understand and learn the 'this' keyword's working principle in JavaScript. As far as I understand 'this' refers to the object (function) that it is inside at that moment. So, by believing this, I wanted to test the output of the simple code below: <body> <input type="button" value="Add Age" onclick="Ou...

Quick regexp to get path

I need to extract the full path to a file using regExp mydomain.com/path/to/file/myfile.html -> mydomain.com/path/to/file/ /mypath/file.txt -> /mypath/ anyone? ...