IP adress
Hello everyone!!
I am new to Lithium.
I want to put some conditions in javascript on the basis of IP Adress.I have to put that condition into my custom compnent ,so that i can use jquery in it.Please suggest me HOW can i do that.
I got ${http.request.remoteAddr} is used to get the IP adress in Lithim.But I am new to Lithum i don't how it can help me tracking an IP and assigning this to a java script variable??
Please help me
Thanks,
Neha
Hi Neha and welcome to Lithosphere,
Usually it's preferrable to handle IP information in Freemarker code. Can you share some more details on what you want to achieve based on the IP address?
If you really really need it in JavaScript it should be possible to have your custom component populate a JavaScript variable with the freemarker one like this:
<script type="text/javascript"> var RemoteIP = ${http.request.remoteAddr}; </script>
...or if you need this info on every page instead of creating a custom component you can add this code to your Lithium skin's header wrapper.