Javascript - change text automatically every 10 secodns
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-29-2013 04:56 AM
Hi,
I need help please. Im beginner in javascript and I learn everething from beginning.
I created UI page.
Result is that UI page display several records each to other (kb query - gliderecord ).
I would like to display every record separately one by one changing every 10 seconds.
See example on screen that now they display all one behind another ....
Is there any change to use javascript to show my variable 1 per 10 seconds which I call $[jvar_inc_link] ?
I would like to learn this how to create code to show results from $[jvar_inc_link] every 10 seconds ..
thanks to all
Petr
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-02-2013 03:40 AM
Konstantin It work now. Great!!!
I forgot to make sure if UI script is global. Not it is global and it work perfect.
Thanks lot, you learned me a lot now.
I have now only second issue, use this whole code but I need put in it some New Array where I put results from Glide Record of KB records.
Have you any idea how to use $[inc.short_description] in this code instead of using this numbers "10000" ?
Shall I somehow move result from GldieRecord --- $[inc.short_description] --- to new Array and then somehow place it in code ?
Please give me some help on this also.
Very appreciate you helped me with a first part to use JQuery - big THX!!!.
Petr
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-02-2013 03:56 AM
Hello,
you have to query GlideRecord in Jelly (), iterate through an array of records () and print out html-code
For reference:
- http://wiki.servicenow.com/index.php?title=Extensions_to_Jelly_Syntax
- http://wiki.servicenow.com/index.php?title=Jelly_Tags
Cheers,
Kostya
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-02-2013 04:12 AM
Query i have already done., but how to please it in array ? Im creating arry first time.
Must i move somehow in to array sys_id of below query ?
<?xml version="1.0" encoding="utf-8">
var inc = new GlideRecord('kb_knowledge');
inc.addActiveQuery();
inc.addQuery('display_attachments','true');
inc.addQuery('topic','General');
inc.query();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-02-2013 04:24 AM
You have the sys_id in the variable ${inc}. Just iterate like here shown: http://wiki.servicenow.com/index.php?title=Jelly_Tags#while
F.e.
<g:evaluate var="jvar_gr" object="true">
var gr = new GlideRecord('kb_knowledge');
gr.addActiveQuery();
gr.addQuery('display_attachments','true');
gr.addQuery('topic','General');
gr.query();
</g:evaluate>
<j:while test="${jvar_gr.next()}">
<a href="kb_knowledge.do?sys_id=${jvar_gr.getValue('sys_id')}">${jvar_gr.getValue('short_description')}</a>
</j:while>
// did not tested 🙂
Cheers,
Kostya
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-02-2013 04:52 AM