Hello guys i have been trying to get a rating star element implemented on my website but i tried many not working out fine, any help please
What have you tried? What’s not working?
A Google search uncovered quite a few.
Thanks, Yh, did a couple of search,
But the rating Stars are not showing up.
My website is running with boostrap.
Without a link to your project anything from here on will be speculation.
Yh, i get it.
The project is a website.
Here: The Project am working on
You will see a Text saying “Two Stars”
Beside it is where the rating stars should appear, but i think am getting it wrong some how.
Here is the working code.
Bootstrap 4 doesn’t include
glyphicons anymore, hence you must use something like Font Awesome and update your code.
Oh okay… Thanks!
So if fixed… that should get the rating stars showing right?
Well, yeah . Just update the HTML and classes to use Font Awesome or whatever other icon library you want to use.
Yh, i have made changes on the classes, now using icons from Font Awesome.
But i the stars are not showing yet.
Do i need to edit something else?
Your HTML code is wrong. You just needed to change the
class attribute, nothing else. Instead you removed some content and some other is simply not valid HTML .
Thanks, am not good at web languages (i only use Java,php often) especially when dealing it JS,
The html is in the Js script. I just shared it on pastebin, please help me on this. Thanks, sorry for the delay in reply.
The Js pastebin link.
I am using this rating star snippet from [This website]
Its works but mine isn’t looking good the html isn’t displaying well
This is how mine looks
Any help will be gladly welcomed thanks!
Looks like you are not loading the required scripts and css:
Just a note on the snippet you are referring to, it may be unjustified but I find the source you are referring to kind of sketchy for the following reasons:
- JQuery version 2.1.1 is old.
- The code does not work properly in Edge or Chrome (Windows - latest version).
- The source code of the JS refers to a different website (haven’t evaluated the code further).
- The website uses tables for non-table content.
- The console logging in a Production environment.
- The amount of advertisements (I get some websites needs adds, but this page has a lot of those without a lot of content).
Personally, I would look for a different (more recent) script. And hey, could be interesting to write this yourself? Can be done with vanilla JS instead of JQuery if you like.