UI Page ( Client script not working)
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-07-2025 02:52 PM
I am new to ServiceNow and need some guidance in troubleshooting my code. I created a UI Page. In which I am calling a script incude ( to load a info. in a table using client script ).
Button click ( Add Dog ) should do the job but not reacting on click.
jQuery('#addDog').click(function() {
var ga = new GlideAjax('fetchUtils');
alert('first check');
ga.addParam('sysparm_name', 'createDog');
ga.addParam('sysparm_dog_name', jQuery('#dogName').val());
ga.addParam('sysparm_dog_age', jQuery('#dogAge').val());
ga.addParam('sysparm_dog_neutered', jQuery('#dogNeutered').is(':checked'));
ga.addParam('sysparm_dog_shots', jQuery('#dogShots').is(':checked'));
ga.getXML(fetchBallback);
});
function fetchBallback(response) {
alert('2 check');
var answer = response.responseXML.documentElement.getAttribute('answer').split('|');
jQuery('#msg').append('<p>' + answer[0] + 'has succesfully been created. Dog ID: ' + answer[1] + '</p><br/><a href="' + answer[2] + '">View new dog</a>');
}
0 REPLIES 0