Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Change item value from 5 to good
#1
Greetings,
I have spent ages searching javascript in Google, but couldn't find any pointers or examples.

I have a range of values returned in a Table ranging from 1 to 50.
Output:
<table> <td>{{response.responsetime}}</td> </table>
If the value is less than 15, want to return it as good (green - cs), rather than 15.

Could anyone kindly point me to the Javascript method/class??? Spent hours searching, but have not returned any useful results..

Regards,

Clive
Reply
#2
The javascript is:

[html]
<div class="grid-child green">
Service Quality
<table class="table" width="25%" class="pos_fixed2">
<thead>
<tbody>
{% for response in service_response %}
<tr>
<td>{{response.service_id}}</td>
<td>{{response.webservicename}}</td>
<td>{{response.responsetime}}</td>
</tr>
{% endfor %}
</tbody>
</thead>
</table>
</div>
[/html]

I tried the javascript below, but get no response. Any suggestions??

Thanks
Clive
<style>
(document.getElementById('pos_fixed2').responsetime:contains(5)').css('color', 'green');
</style>
Reply
#3
I'm confused. In both posts, you're showing a template which is executed on the server and are talking about JavaScript, which is executed on the client. On which end do you actually want to make the change?
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020