Any client side option is not a good idea, because they are provided by the computer based on the wireless networks around. I bet that 90% of desktop users don't have this feature activated. When you get to a website that want your location, you have to click a button to agree to. If they just got on your website, then they want to know first why you need their location.
A good way is to show them a page to inform them why you need their location and that you will never use it for any other purposes than the specified one, and the location will not be saved in your database.
If there is a script that runs server side, then there is a connection from the client to the server. In this case the Server must know the IP Address. There is a trick that you can do to get the IP Address first.
Make a php script on your server, that will return only the IP Address. Since the jquery is processed locally, when a connection is made to the server, the client IP Address will be disclosed. It will take some additional time to make the required connections but soon the IP Address will be available in jQuery.
Then, you can call trough jquery an external API that will give you information for that specific IP Address. Either you buy an IP Database and install it on your websserver so you can call it, either you use another API. You can check http://www.ipgp.net/ip-address-geolocation-api/
ESP
plugin. Seriously though, the answer is "no", you can't do this with just client-side code. – Furriery