ccristian
10-04-2011, 01:29 PM
I'm trying to create/find a script that will do the following:
-load a css file regardless of any conditions.
-do not load the css file if a certain text is present in a specified html div tag.
i know this is done with a if/else state like this:
if (condition)
{
code to be executed if condition is true
}
else
{
code to be executed if condition is not true
}
but I do not know how to add the condition for the variable text and to specify the css file.
I want the javascript to ignore loading the css if a div tag like this: <div class="menu-opener"><a class="gwt-Anchor" href="javascript:">Text1<img src=..//img.jpg"></a></div>contains the word Text1, or any other I specify.
Else, if any other text inside the div, the css should load normally.
I believe this is not difficult for a js knower and I would be very grateful for a solution.
-load a css file regardless of any conditions.
-do not load the css file if a certain text is present in a specified html div tag.
i know this is done with a if/else state like this:
if (condition)
{
code to be executed if condition is true
}
else
{
code to be executed if condition is not true
}
but I do not know how to add the condition for the variable text and to specify the css file.
I want the javascript to ignore loading the css if a div tag like this: <div class="menu-opener"><a class="gwt-Anchor" href="javascript:">Text1<img src=..//img.jpg"></a></div>contains the word Text1, or any other I specify.
Else, if any other text inside the div, the css should load normally.
I believe this is not difficult for a js knower and I would be very grateful for a solution.