i want to use a JS var in the dropdownlist selection change ajax data option, but couldn’t work it out.
Always get this error:
PHP Error
Description : Use of undefined constant eml - assumed ‘eml’
[color="#0000FF"]
<script type=“text/javascript”> var eml=’’; </script>[/color]
dropdownlist ajax code:
[color="#0000FF"]
‘ajax’ => array(
...
'data'=>"js:{did: $(this).val(),
exclude: "[color="#8B0000"]+ eml +[/color]"; }
}",
)
[/color]
The eml value gets modified on other events.
The ajax is working all fine if i remove the eml variable from there & calculate the value within it using function(){ … }.
But its slowing the whole process by running a loop everytime the selection gets change which is completely unnecessary when the value is already there in a JS variable.