Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CClientScript renderBodyEnd() bug #1744

Closed
DrDeath72 opened this issue Nov 22, 2012 · 12 comments
Closed

CClientScript renderBodyEnd() bug #1744

DrDeath72 opened this issue Nov 22, 2012 · 12 comments

Comments

@DrDeath72
Copy link

Must insert before last [/body] but insert before first. Second [/body] can be in banners insert comments

@cebe
Copy link
Member

cebe commented Nov 22, 2012

why should there be more than one </body> tag?

@DrDeath72
Copy link
Author

js comments with instructions of banner code insert for example

@mdomba
Copy link
Member

mdomba commented Nov 22, 2012

There was a forum topic regarding this... problem is that in the DOM there is only one BODY... commented body's cannot be detected

@mdomba
Copy link
Member

mdomba commented Nov 22, 2012

Found the topic, it's similar but not regarding the ending body tag - http://www.yiiframework.com/forum/index.php/topic/36572-detection-of-real-body-in-conditional-comments/

@DrDeath72
Copy link
Author

ok... replace tag in banner code before save them...

@mdomba
Copy link
Member

mdomba commented Nov 22, 2012

I don't understand what you mean with "banner code"... can you post an example with multiple body tags ?

@DrDeath72
Copy link
Author

i have table for banners, part of them with body insert instruction comments in code, when i save them to db i will replace body tag in instruction

@samdark
Copy link
Member

samdark commented Nov 22, 2012

@mdomba he's talking about <!-- Insert this after <body> --> or something like this. A tag inside a comment.

It's not very common situation so I'm not really sure if it worth fixing it. If there's an easy fix, we'd apply it, of course. Still, not a priority task.

@mdomba
Copy link
Member

mdomba commented Nov 22, 2012

I'm still not clear on the usage of such things... why would such comments be rendered on the resulting page so that visitors can see that by checking the page source?

problem is that someone else could possibly have similar tags after the BODY and that one would like scripts to be inserted before the first BODY... then someone else can have such scripts before and after the BODY... so I don't see a solution for such things.

@samdark
Copy link
Member

samdark commented Nov 22, 2012

Well, solution is not to check things inside HTML comments but to do we have to use lookahead and lookbehind in regex that will complicate regex and make it slower.

@mdomba
Copy link
Member

mdomba commented Nov 22, 2012

Check the example on the forum post (the link I posted above)... there all the BODY tags are inside different comments (conditionals)...

@samdark
Copy link
Member

samdark commented Nov 22, 2012

Yeah, that's the same thing.

@samdark samdark closed this as completed Mar 13, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants