Is it possible to get the Server IP Address from Javascript
ie., when the user types "http://10.0.0.10/main.htm" in the web
browser, i need to retrive the value of the IP Address(10.0.0.10) from
my client side javascript.
I have spent the better part of a day trying to figure this out, but cannot get it to work. What I am trying to do it reverse the background color of a cell with the font color and vise-versa. However for some reason I cannot get JavaScript to obtain the current assigned value of a CSS style. Code:
I have a textfield and you of course you can select text...
When they hit the bold button I want it to obtain the selected text and bold it, the hard part is trying to figure out if javascript can even OBTAIN selected text?!?!
I can do this in java if I have to, I know java better than javascript, it seems as that is the only way to do it from looking online.
I want to find real IP Address of computers that are connected to my company's website. All users who want to see our website pass from our ISA Server. So, if I want to get their real IP Address with javascript commands, I'll get one and only one IP Addres from anywhere that is our ISA Server address. How I can get real ip address of those computers and compare it with predefined address?
I know you can use javascript in the address bar to display alert messages and misc. stuff like that. But when I try and control some forms it loadsa a new page for the loaded example...
Right now what I have is an .htaccess file which blocks users not on my ip address list. But what I really want is a filter that will gather the ip address of the viewer, compare it against the server's ip address list, and redirect the viewer to a certain other link based on the viewer's ip address.
example: user types in www.example.com, and according to ip address, is redirected to their own personal subdomain:
what is the javascript validation for the email address like php.ycho@gmail.com
i used the simple validation like "^w{1,}@w{1,}(.w{1,}){1,}$"
which works well for php@gmail.com but doesnot work for php.ycho@gmail.com can anybody make a modification to above pattern to work for php.ycho@gmail.com
I need a simple js function that will check if the value (an email address) in two text fields match.
If someone enters creole@creole.com in "fieldOne" and creoel@creole.com in field two it would throw an error. If they matched, the form would submit silently.
Can someone help me out? I think it should be easy, and I'm trying to do it myself, I'm just not good enough at js.
However, this piece of Javascript uses some other script which is large.
<script src = "./js/tmp.js".....>
This will work if the file "tmp.js" is local. However this reduces the portability of my *utility* Javascript as users have to have that "tmp.js" for every webpage they have (if they want to use it :D)
I thought of uploading "tmp.js" it to somewhere and change my code to
I'd like to implement a server socket in java: something linke the following example.
The problem is that the HTML has not the permission to execute instruction serverSocket = Components.classes["@mozilla.org/network/server-socket;1"]. createInstance(Components.interfaces.nsIServerSock et);
Question:
1 - how do I give it this permisison?
2 - one solution I thought was to put the javascript code in a firefox extension, to load, so it should have all needed permisison, but, How can I call a java script function define in an extension from an html page? - there's some particular syntax? ....
I have three different web pages with different domains, and I want to show some pages of one of the webs in the others.
I use an iframe for this and it shows it good until I have to call a javascript function in the iframe inside page, I have a permission denied because the domains of these pages are different.
So, the cuestion is:
Is there some way to call the javascript function of the iframe from the parent page?
I might be turning a corner today and seeing the light. I might still be confused :)
If JavaScript is the language for the browser then why do servers use Ruby/Rails, Perl/Catalyst, Python/Turbogears or PHP/Cake? Is it because the prototype-based language is too different to be chosen except when necessary. Is it because browser bugs make people think JavaScript is bad? Is JavaScript not suitable for the server-side for any reason?
I imagine that if server-side programmers started to learn JavaScript then the client-side code in the world might start to improve. Translation layer libraries like Prototype.js or Mochikit wouldn't need to exist. The more I learn about JavaScript the more I like it. It is difficult to learn however for multiple reasons.
I have seen web pages sites, when you drop down a list box, it seems to go back to the server to retrieve some data without reloading the whole page (e.g. select make of car and it retrieves a list of models from the server to populate another list box).
I was handed a project that, when launched, had some ajax problems--specifically, "Error: uncaught exception: Permission denied to call method XMLHttpRequest.open." That's easy enough to fix--found the call in the .js file that was referencing the development server instead of the live server, and I am aware of Javascript's same-origin policy, which makes good clean sense. Change that call, problem solved.
Unfortunately, it's not solved. I can change the reference from var url='http://www.devserver.com/function.php?id='+id; to var url='http://www.liveserver.org/function.php?id='+id; but that doesn't solve the issue of if someone comes to the page without the 'www' or to the other domain, whose TLD is a .com instead of .org.
In PHP, I'd simply write the function to dynamically generate the url string, using $_SERVER variables rather than hardcoding the url. But I'm no javascript guy. Any help would be appreciated.
I'd rather not have to put a php redirect in every page to make sure the url is what I want it to be. I'd much rather learn something new about Javascript.
I have a number of server-side Javascript applications running on an old Netscape Enterprise server. I want to move them to Apache. Is there a way to do this without extensive recoding ? My code contains a lot of Oracle and SQL Server database interaction.
I want to populate my client's webpage (Remote Server) automatically through my Server and Database by having him just paste a javascript on his webpage.
I have read up about Microsoft Remote Scripting but the documentation states the following : "The server which you make remote scripting calls must be the same server from which you requested the client page containing the requests."
In my case , the client and server pages are on two seperate servers which means that I cannot use MS Remote Scripting.Is there an alternate approach in any scripting language ???
Any suggestions, tutorials , websites , code snippets will be appreciated while i continue to research on this...
Now that http://username:password@site.com no longer is an accepted syntax in IE, I suddenly have a case in a project I'm working on. The easiest(?) solution would now be that there was some Javascript function that could pass the username and password or in som other way automate the login process on a given site.
Thing is I have a server-generated HTML page that I want to make the client redirect to a password protected site. (IIS Windows authentication).
I'd like to adapt some Greasemonkey scripts that I've written and have them applied to html files on the server side before the files are sent to users. I'm only looking at adapting scripts that make static changes to pages. For instance, consider a script that removes from the DOM any img that has "ad" in its src.
I'm sure there are better ways to do this and I'm not even necessarily looking for an extremely efficient solution. Mostly, I just want to know if there's an existing product that could do this or with reasonable effort could be made to do this.
I want control a hardware device using a Web browser. I created a page which has a form containing all necessary INPUTs. By clicking a button, all current settings are sent to the server side (using POST or GET) so that the server can interact with the hardware, which is under the server's control.
Now, in some cases, I want to update the INPUT (w/ readonly) with the data from the hardware, such as a status value. Most primitive approach is creating a new page with new value to the INPUT, where I want to show the value.
But that is not quite efficient as the page appearance won't change except the contents of the INPUT.
As Javascript can make any change to the HTML page (at client's side) that is currently being displayed, it is more straight forward if the server can send a set of Javascript commands to the web server so that it can just update the display contents rather than refreshing everything.
I thought such scheme was already available, but so far, I don't see anything usable.
The Web server is not a commercial one but a custom Web server (written in Python) so that I want to keep the scheme as simple as possible. I checked AJAX but I'm not sure I can use AJAX in my application.
I am a .Net Developer. I want to know to write javascript for serverside controles.And where it is placed for sever sidr controls. Please tell me if any one know this.
How portable is server side javascript? Does server side javascript works the same across different browsers and operating system? What I should do to ensure it is more portable?
I am using a location in my javascript: '../../myfolder/myfile.asp'
I want to make the script reusable by pages in different folders. The 'myfolder' is in the root of my site. How can I target this from any other folder such as the vbscript server.mappath('myfolder/myfile.asp')?