0

what I want to do is the following I have a .js where I have a code that I want to work but I have to pass some parameters

<script src="~/Scripts/Test.js?controller=1111" />

js file

control male

function TrackLayout (layout) {

     var value = controller;
     if ($ ('# gvlayout' + value) .val () === '') {
         $ ('# gvlayout' + value) .val ('');
         $ ('# gvlayout' + value) .val (layout);
     }
     $ ('# gvlayout' + value) .val (layout);
}
2
  • It is not clear what do you want to achieve, JS file does not receive parameters like this, you can read current page url parameters in js... Commented Dec 15, 2017 at 13:52
  • I want the file js can get the controller value that goes in the url Commented Dec 15, 2017 at 14:00

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.