Turn On GPS : Direct to menu setting android

Hi

I have a task to direct from app to menu setting if gps turn off. 

I tried use java script below:

var x = new Intent(android.provider.Settings.ACTION_LOCATION_SOURCE_SETTINGS);

startActivity(x); 

the result is intent  is undefined


So the question is: what is javascript's code to direct from your app to android setting


Thanks