1

I am a little bit new to yii. I am using the following code to create the main template:

<html xmlns="http://www.w3.org/1999/xhtml">
<title>Schedule an appointment with My business</title>
<link href='https://fonts.googleapis.com/css?family=Signika' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="<?php echo Yii::app()->request->baseUrl; ?>/css/bookpage/style.css" type="text/css">
<link rel="stylesheet" media="all" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/modal-form-css/jquery-ui.css" />
<link rel="stylesheet" href="<?php echo Yii::app()->request->baseUrl; ?>/css/bookpage/appointpress.css" type="text/css">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="<?php echo Yii::app()->request->baseUrl; ?>/css/datepickercss/jquery.ui.datepicker.css" type="text/css">
<link rel="stylesheet" href="<?php echo Yii::app()->request->baseUrl; ?>/css/datepickercss/jquery.ui.theme.css" type="text/css">
<link rel="stylesheet" href="<?php echo Yii::app()->request->baseUrl; ?>/css/datepickercss/jquery-ui.css" type="text/css">

<!--<script type="text/javascript" src="//sslstatic.wix.com/services/js-sdk/1.19.0/js/Wix.js"></script> -->

<div class="header" style="height:60px;">
    <div id="inner_header" style="padding-top:5px;">
    <span style="float:right;color:rgb(68, 68, 68); margin-top:-10px;"><a href="http://appointpress.com">Appointpress</a> | Powerful Online Scheduling</span>
    </div>
</div>
<body style="background-color:FFFFFF; font-family:Signika">
    <div class="container-fluid">
            <?php echo $content; ?>
    </div>
    <script src="<?php echo Yii::app()->request->baseUrl; ?>/css/appcal/jquery-1.9.1.js"></script>
    <script src="<?php echo Yii::app()->request->baseUrl; ?>/css/appcal/jquery-ui-1.10.2.custom.js"></script>
    <!--date validation-->
<script type="text/javascript" src="<?php echo Yii::app()->request->baseUrl; ?>/js/date.js" /></script> 
</body>
</html>

But in console I am getting some CDATA added in the last of the file when I see it into console.

    <script type="text/javascript" src="/customers/js/date.js" /></script>  
<script type="text/javascript">
/*<![CDATA[*/
jQuery(function($) {
jQuery('a[rel="tooltip"]').tooltip();
jQuery('a[rel="popover"]').popover();
});
/*]]>*/
</script>
</body>

thats not a problem in Firefox or Google chrome. but is problematic in IE. I am not able to figure out that from where it is coming out and how to remove this ?

Please guys help in out of this problem ?

Thanks

Rohitashv Singhal
  • 4,517
  • 13
  • 57
  • 105
  • 2
    possible duplicate of [CDATA being added automatically on JS in Yii?](http://stackoverflow.com/questions/16656317/cdata-being-added-automatically-on-js-in-yii) – Samuel Liew Jul 31 '13 at 07:54

1 Answers1

1

This is automatically created by Yii to prevent misinterpretation by old browsers, XML-Files or non JavaScript aware browsers. This should not cause any problems at all. Can you post a error message?

Furthermore when using Yii, you should use these "Yii-methods" to include JavaScript:

<?php  
  $baseUrl = Yii::app()->baseUrl; 
  Yii::app()->getClientScript()->registerScriptFile($baseUrl.'/js/someJs.js');
?>

Also check the Yii-Docu on JS: http://www.yiiframework.com/wiki/394/javascript-and-ajax-with-yii/#hh6

user619
  • 119
  • 5
  • I am getting error : ` Object doesn't support this property or method 224, line 443 character 1` Line 443 is : – Rohitashv Singhal Jul 31 '13 at 08:29
  • 1
    ok, you are using some JavaScript / Jquery that IE has problems with. This has nothing to do with the CDATA Tags. In this case you have to review your jquery code. – user619 Jul 31 '13 at 08:55