cPanel is giving me a warning for my below eval() line in JS. What could a put that’s a Safe Alternative? Thanks! ![]()
let result = eval(expression);
cPanel is giving me a warning for my below eval() line in JS. What could a put that’s a Safe Alternative? Thanks! ![]()
let result = eval(expression);
your safe alternative is to build the logic for each calculator function
Thanks for the Logic info! Please reply with an example of that. ![]()
I don’t have an example to give you for your code, I have no idea what you have shared
but like if you have expression 5+2 instead of using eval you would need a sum function that does sum(5, 2)
Here’s a link to the whole pen. ![]()
Also, when I text on iPads, or iPhones, the Results box Doesn’t appear to center style, and goes off to the Right, unless that’s now fixed. ![]()
how are you going to try to convert the logic in the app? it’s bad idea to use eval on user input directly
I based this calculator off of another calculator, making a number of edits. This calculator runs very well! I briefly commented out the Eval coding as a test, and the calculator Stopped running properly.
I’m okay with Changing the Eval coding to Function coding. However, I’m Not yet fully sure what the Function coding should be. Please reply with the Proper Function coding. Much Thanks! ![]()
If you want to code the calculator yourself you will need to write also the code, I am not going to write the code for your app for you
Otay, please at least suggest how I can get the Results box to center properly on iPhones, and iPads. Thanks! ![]()
share what issue you are having, a screenshot, something
I am not able to reproduce this
Are you using a iPhone? ![]()
No, I am not using an iPhone
At Best Buy, I Changed the Results width to 260px. Now the Results Box is Centered on iPhones, and iPads.
I might keep the Eval code since cPanel Doesn’t give a major warning. ![]()
This calculator is partly for one of my internet sites. I mainly need ? + ?, or ? x ? and ? x ?%. Most simple or advanced online Calculators that I’ve seen Don’t have a % button. ![]()
I ReDid the Whole calculator, and now the calculator runs Without Eval JS! ![]()
The Only way that I currently know how to call a .scss file is via Inline CSS. Is that the Best way? ![]()
the only inlice css you have used is tyle="font-family: Arial; text-align: center; color: #4169E1", why don’t you put that too in the scss file
The Top CSS is Only for CodePen. I have the calculator on one of my personal internet sites, and the Only way I could guess to get the calculator to view is having the SCSS Inline.
As you know REL= Isn’t compatible with SCSS. ![]()