I've been playing with Livecode server recently, but what seems obvious to me , or would work in livecode, doesn't appear to work in webpage.
Example - login page
It posts username and password to another LC page that does it's bit, and if invalid returns user back to login page with an error ie: login.lc?error=1 (this part all works fine and as expected)
I'm trying this in the location i wish the error to appear
<?lc
Global gErrText
If gErrText is not empty then
Put "<div class="alert alert-danger" role="alert">"
Put "<strong>"&gErrtext&"</strong>"
put "</div>"
end if
?>
This line" Put "<div class="alert alert-danger" role="alert">" (or any line with mention of class) results in a livecode error
file "E:/SERVER/Apache24/htdocs/login.lc"
row 76, col 32: put: preposition must be 'before', 'into' or 'after' (alert)
row 76, col 32: if: error in command (alert)
row 76, col 32: script: bad statement (alert)
How do I use html code with put statements, other than basic <p> <strong> etc tags ? Or how to make them HTMl/lc friendly without manual dibbling of html string.
Thanks
Mixing HTML & LC
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Re: Mixing HTML & LC
Hi Paul,
At first glance, I believe it may be an inner quote issue with the first put statement.
Try this:
Also, when posting to the forum, you should always post your code inside of the code display markup keywords.
I hope this helps.
Tim
At first glance, I believe it may be an inner quote issue with the first put statement.
Try this:
Code: Select all
Put "<div class=" & quote & "alert alert-danger" & quote & " role=" & quote & "alert" & quote & ">"
I hope this helps.
Tim
-
- VIP Livecode Opensource Backer
- Posts: 115
- Joined: Tue Feb 23, 2010 10:53 pm
- Location: Saint Louis, Missouri USA
Re: Mixing HTML & LC
I think the problem is with the space character and the hyphen in the class:
Also make this change in the css definition (or wherever is used).
Hope that helps.
Bob
Try putting an underscores in their places.Put "<div class="alert alert-danger" role="alert">"
Code: Select all
...class="alert_alert_danger"...
Hope that helps.
Bob