Because web.py has defined the "$" symbol bit delimiter in the template, special handling is required in the template if the dollar sign is to be used.
If I want to output the "$name" string in the template:
Copy Code code as follows:
Error
$name is considered a variable instead of being treated as an HTML string. If you want to output the "$name" string You must write this:
Copy Code code as follows:
Save to run the correct output.
Especially when mixing with jquery, be aware of it. Such as:
Copy Code code as follows:
$ ("id"). html ("cloud-dwelling community");
To be modified into:
Copy Code code as follows:
$$ ("id"). html ("cloud-dwelling community");
So that you can use it.
Because Python is a server-side language, JS is the client language. Server-side language finally put:
Copy Code code as follows:
$$ ("id"). html ("cloud-dwelling community");
Translate into:
Copy Code code as follows:
$ ("id"). html ("cloud-dwelling community");
Then throw it to the client instead of jquery and use the double dollar sign "$$" ("id"), and don't get the idea wrong.