I'm writing a web page in ASP.NET. I have some Javascript, and I have a submit button with an onClick event.
Is it possible to call a method I created in ASP with Javascript's onClick event?
I need to getting the client ip address using javascript.Actually,our connection provider ip is something like this 122.172.127.200.We are putting different private ip like 192.168.10.1,192.168.10.2 and so on..i can retrieve 192.168.10.1,but how can i retrieve the 122.172.127.200 using php or javascript.SSI already enabled.Please help me....Thanks
I read this article regarding creating popup notes with javascript and css
The problem is that this one works only in IE since window.event is undefined in Firefox.
// assigns X,Y mouse coordinates to note element
note.style.left=event.clientX;
note.style.top=event.clientY;
So could you point me a fully working example? Or at least, how could i modify the javascript code to make it work in both internet browsers?
I want to display OpenOffice files, .odt and .odp at client side using a web browser.
These files are zipped files. Using Ajax, I can get these files from server but these are zipped files. I have to unzip them using JavaScript, I have tried using inflate.js, http://www.onicos.com/staff/iz/amuse/javascript/expert/inflate.txt, but without success.
How can I do this?
I've searched around for the answer to this and found lots of much
more complicated questions, but none that gave me insight enough to
figure this one out.
What I'm doing:
1- open a page with a number that will probably be large
2- get the X Path to where that number is and store it to a variable
3- do a javascript to compare the above stored variable to see if it is bigger than 10, if so, set a new varaible to true; else false (because that is the default value)
4- verify the variable in #3 is true
Sounds simple enough, no?
Where it goes wrong:
At step 3, comparing the variable from step #2 to 10 isn't allowed, at least not the way I'm writing it.
Why?
Details:
<tr>
<td>open</td>
<td>http://www.google.com/search?hl=en&q=selenium+verifyEval</td>
<td></td>
</tr>
<tr>
<td>store</td>
<td>/html/body/div[5]/div/p/b[3]</td>
<td>resultCount</td>
</tr>
<tr>
<td>storeEval</td>
<td>var isMoreThan10 = new Boolean(); isMoreThan10 = (resultCount > 10);</td>
<td>isMoreThan10</td>
</tr>
<tr>
<td>verifyExpression</td>
<td>${isMoreThan10}</td>
<td>true</td>
</tr>
I just thought of one possible workaround: Exapnd the javascript code to get the value there & assign it to a variable there so I'll be more likely to be able to use that variable in the javascript. Not sure exactly how that would be done- anyone wanna help with that?
But surely there is be a better way, isn't there? I must be able to assign a value to a variable in Selenium, then in the next line use that variable in a javascript, right?
I have quite a number of user controls that I need to embed in Umbraco macros. Each user control has quite a bit of in page javascript that needs loaded into the page.
I have been building up the javascript with StringBuilder.Appendline then registering a startup script with code behind but this stinks and I feel there has to be a better way of going about this.
Has anyone any ideas please?
Thanks,
B
I'm planing on giving an introduction talk on JavaScript and in the preparation process I wondered what the top pitfalls are that rookies fall into.
I know I've had a few gotchas before I fully understood closure, but much of the strange behavior in JavaScript is not something I think about any more...
So, which pitfalls should you deffinately point out to the rookies?
Hi, I am wondering if there is a Javascript equivalent of php's parse_url. Currently, I wrote my a simple parser with regex; however, I would think that such function already exists in the in Javascript.
Hi,
I would like to open a webpage and run a javascript function from within a java app.
For example I would like to open the page www.mytestpage.com and run the following javascript code:document.getElementById("txtEmail").value="[email protected]";submit();void(0);
This works in a browser...how can I do it programatically?
Thanks!
Hello,
I am using the ExternalInterface to communicate between Flash and JavaScript using callbacks and the call method. I would like to throw an exception in ActionScript 3.0 and catch it in JavaScript and I was please wondering if there was anyway to do that?
Thank you very much,
Rudy
Hi,
How can I evaluate's document.write javascript to plaintext in C#? I'm trying to evaluate this:
<script type="text/javascript">
a=2;b=3;
document.write(a+"_"+y);
</script>
to this:
2_3
Hello, I am posting this question for the third time because never got correct answer. I want to open 2 windows on 1 click. Don't tell me to use window.open twice because I want to open one javascript banner i.e.
''
and one website that can be any like google or yahoo and it can easily open with window.open but how can I open the banner which is in the javascript code with second site?
From my previous question(Create json using JavaScriptSerializer), In .ashx file I am printing the json object using:
context.Response.ContentType = "application/json";
context.Response.Write(json);
I am calling this .ashx file from default.aspx which has some javascript function inside its <head> tag.
My question is :
How will I be able to call the javascript function from .ashx file after context.Response.Write(json);?
I have a JavaScript function that loads a flash movie into a webpage div using swfobject.embedSWF().
I want to be able to, alternatively, load a .mov file into the same div, in the event that this is the file found instead of the .swf.
Is there a close equivalent to swfobject.embedSWF for the purposes of embedding a .mov file? If not, what is an efficient route to doing this using JavaScript?
I want to use Google Chart API using javascript. (I don't want to use the python wrapper)
So how do I send data from my python code into the javascript to create graphs?
Is there a way to test to see if javascript is enabled to ensure an application that required javascript is not initiated when it is disabled or otherwise not available?
I have a text box called txtName on my form.
In my page I know I need to place the code in my HEAD tag like so......
<script type='text/javascript' language="javascript">
document.forms['FormName'].elements['txtName'].value = "Robert"
</script>
But I cant seem to set a value inside my text box.
Hi I'm passing a unixtimestamp to a javascript IF statement, can anyone tell me how to generate a unixtimestamp one minute in the future with javascript.
Anyhelp would be helpful.
Thanks
I am using below code for javascript window "Yes/No". It is firing twice. Is there any way I can avoid this? Or use any other code?. I need this code behind.
Response.Write("<script language='javascript'> { self.close() }</script>");
I am creating one admin page where I have multiple textboxes.when I enter the userid in one textbox I want to display user name in next textbox when admin moves to next text box.for this I can use ajax or javascript? which one will be better?how can I do it through javascript.
I have a JavaScript variable which holds an HTML page and due to the setup I need to extract everything between <div id="LiveArea"> and </div> from that variable using JavaScript.
Any help is greatly appreciated.
I'm trying to write a code that can run on Android 1.5 and 2.0.1, but I have issues with the javascript engine used on Android 1.5.
alert(localStorage); just hang on v1.5 while on v2.0.1 it alerts correctly.
is there an unblocking way to do it or to detect the version of Android with javascript?
I am newbie.
many of javascript code start with <!--
<script type="text/javascript">
<!--
and finish with //-->
//-->
</script>
I think the reason is for compatibility.
But I cannot find the clue in any books.
even I cannot find anything with google.
I want to parse a html-page that unfortunately requires JavaScript to show any content. In order to do so I use a small python-script that pulls the html-code of the page, but after that I have to execute the JavaScript in a DOM-context which seems pretty hard.
To make it even harder I want to use it in a server environment that has no X11-server.
Note: I already read about http://code.google.com/p/pywebkitgtk/ but it seems to need a X-server.
I was hoping to make a website that displays a google map with points based of information returned by a C++ function. I know you can use Java Server Pages to call java methods on the server with javascript. Would there be a way to connect C++ code on the server with javascript in order to produce the same result as java server pages?