The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.
|
 |
|
Dev Shed Forums
> Programming Languages
> PHP Development
|
Howcom view source shows the scripts content!
Discuss Howcom view source shows the scripts content! in the PHP Development forum on Dev Shed. Howcom view source shows the scripts content! PHP Development forum discussing coding practices, tips on PHP, and other PHP-related topics. PHP is an open source scripting language that has taken the web development industry by storm.
|
|
 |
|
|
|
|

Dev Shed Forums Sponsor:
|
|
|

February 11th, 2013, 11:24 PM
|
 |
A Change of Season
|
|
|
|
|
Howcom view source shows the scripts content!
Hello
How are you?
This is not a php issue really but I thought I post here this is home.
Recently when I view source, I see the content of all <script> tags for some reason!
For example instead of
<script src="color.js"></script>
I see its content as below:
Code:
img.tcalIcon{cursor:pointer;margin-left:1px;vertical-align:middle;}/**/div#tcal{position:absolute;visibility:hidden;z-index:100;width:158px;padding:2px 0 0 0;}/**/div#tcal table{width:100%;border:1px solid silver;border-collapse:collapse;background-color:white;}/**/div#tcal table.ctrl{border-bottom:0;}/**/div#tcal table.ctrl td{width:15px;height:20px;}/**/div#tcal table.ctrl th{background-color:white;color:black;border:0;}/**/div#tcal th{border:1px solid silver;border-collapse:collapse;text-align:center;padding:3px 0;font-family:tahoma,verdana,arial;font-size:10px;background-color:gray;color:white;}/**/div#tcal td{border:0;border-collapse:collapse;text-align:center;padding:2px 0;font-family:tahoma,verdana,arial;font-size:11px;width:22px;cursor:pointer;}/**/div#tcal td.othermonth{color:silver;}div#tcal td.weekend{background-color:#ACD6F5;}div#tcal td.today{border:1px solid red;}div#tcal td.selected{background-color:#FFB3BE;}/**/iframe#tcalIF{position:absolute;visibility:hidden;z-index:98;border:0;}/**/div#tcalShade{position:absolute;visibility:hidden;z-index:99;}div#tcalShade table{border:0;border-collapse:collapse;width:100%;}div#tcalShade table td{border:0;border-collapse:collapse;padding:0;}
</style>
<link rel="stylesheet" type="text/css" href="css/prototip.css" /><link href="css/default.css" rel="stylesheet" type="text/css" media="screen" /><link rel="shortcut icon" href="favicon.ico" /><style type="text/css"><!-- @import url("css/default.css");--></style> <!--[if lt IE 7.]><script defer type="text/javascript" src="pngfix.js"></script> <![endif]--><!--[if IE 7]><style type="text/css" media="all">@charset"utf-8";#nav_container ul li.left a.left{&margin-left:232px;}#nav_container ul li ul{display:none;position:absolute;top:38px;&left:283px;z-index:550;border-bottom:solid 0px #999999;padding-left:10px;}#nav_container ul li ul.r{&left:765px;}</style> <![endif]--><script type='text/javascript' src="scriptaculous/src/scriptaculous.js"></script> <script type='text/javascript' src='httdps://ajax.googleapis.com/ajax/libs/prototype/1/prototype.js'></script> <script type='text/javascript' style="display:none">var A_TCALDEF={'months':['January','February','March','April','May','June','July','August','September','October','November',' December'],'weekdays':['Su','Mo','Tu','We','Th','Fr','Sa'],'yearscroll':true,'weekstart':0,'centyear':70,'imgpath':'img/'};function f_tcalParseDate(s_date){var re_date=/^\s*(\d{1,2})\/(\d{1,2})\/(\d{2,4})\s*$/;if(!re_date.exec(s_date))
return alert("Invalid date: '"+s_date+"'.\nAccepted format is dd/mm/yyyy.")
var n_day=Number(RegExp.$1),n_month=Number(RegExp.$2),n_year=Number(RegExp.$3);if(n_year<100)
n_year+=(n_year<this.a_tpl.centyear?2000:1900);if(n_month<1||n_month>12)
return alert("Invalid month value: '"+n_month+"'.\nAllowed range is 01-12.");var d_numdays=new Date(n_year,n_month,0);if(n_day>d_numdays.getDate())
return alert("Invalid day of month value: '"+n_day+"'.\nAllowed range for selected month is 01 - "+d_numdays.getDate()+".");return new Date(n_year,n_month-1,n_day);}
function f_tcalGenerDate(d_date){return((d_date.getDate()<10?'0':'')+d_date.getDate()+"/"
+(d_date.getMonth()<9?'0':'')+(d_date.getMonth()+1)+"/"
+d_date.getFullYear());}
function tcal(a_cfg,a_tpl){if(!a_tpl)
a_tpl=A_TCALDEF;if(!window.A_TCALS)
window.A_TCALS=[];if(!window.A_TCALSIDX)
window.A_TCALSIDX=[];this.s_id=a_cfg.id?a_cfg.id:A_TCALS.length;window.A_TCALS[this.s_id]=this;window.A_TCALSIDX[window.A_TCALSIDX.length]=this;this.f_show=f_tcalShow;this.f_hide=f_tcalHide;this.f_toggle=f_tcalToggle;this.f_update=f_tcalU pdate;this.f_relDate=f_tcalRelDate;this.f_parseDate=f_tcalParseDate;this.f_generDate=f_tcalGenerDate ;this.s_iconId='tcalico_'+this.s_id;this.e_icon=f_getElement(this.s_iconId);if(!this.e_icon){documen t.write('<img src="'+a_tpl.imgpath+'cal.gif" id="'+this.s_iconId+'" onclick="A_TCALS[\''+this.s_id+'\'].f_toggle()" class="tcalIcon" alt="Open Calendar" />');this.e_icon=f_getElement(this.s_iconId);}
this.a_cfg=a_cfg;this.a_tpl=a_tpl;}
function f_tcalShow(d_date){if(!this.a_cfg.controlname)
throw("TC: control name is not specified");if(this.a_cfg.formname){var e_form=document.forms[this.a_cfg.formname];if(!e_form)
throw("TC: form '"+this.a_cfg.formname+"' can not be found");this.e_input=e_form.elements[this.a_cfg.controlname];}
else
this.e_input=f_getElement(this.a_cfg.controlname);if(!this.e_input||!this.e_input.tagName||this.e_in put.tagName!='INPUT')
throw("TC: element '"+this.a_cfg.controlname+"' does not exist in "
+(this.a_cfg.formname?"form '"+this.a_cfg.controlname+"'":'this document'));this.e_div=f_getElement('tcal');if(!this.e_div){this.e_div=document.createElement("DIV");this.e_div.id='tcal';document.body.appendChild(this.e_div);}
this.e_shade=f_getElement('tcalShade');if(!this.e_shade){this.e_shade=document.createElement("DIV");this.e_shade.id='tcalShade';document.body.appendChild(this.e_shade);}
t.....
|

February 12th, 2013, 12:22 AM
|
 |
Code Monkey V. 0.9
|
|
Join Date: Mar 2005
Location: A Land Down Under
|
|
What you've copied there is correct. When you actually look at the tags with correct formatting, the JS script links are:
Code:
<script type='text/javascript' src="scriptaculous/src/scriptaculous.js"></script>
<script type='text/javascript' src='httdps://ajax.googleapis.com/ajax/libs/prototype/1/prototype.js'></script>
<script type='text/javascript' style="display:none">
var A_TCALDEF={'months':['January','February','March'...
The JS code there is set up in a standard script tag the way that it should be. There's no JS that's being displayed from the external files.
|

February 12th, 2013, 12:53 AM
|
 |
A Change of Season
|
|
|
|
Quote: | Originally Posted by Catacaustic What you've copied there is correct. When you actually look at the tags with correct formatting, the JS script links are:
Code:
<script type='text/javascript' src="scriptaculous/src/scriptaculous.js"></script>
<script type='text/javascript' src='httdps://ajax.googleapis.com/ajax/libs/prototype/1/prototype.js'></script>
<script type='text/javascript' style="display:none">
var A_TCALDEF={'months':['January','February','March'...
The JS code there is set up in a standard script tag the way that it should be. There's no JS that's being displayed from the external files. | It used to be different! Never saw the actual JS code.
|

February 12th, 2013, 04:26 PM
|
 |
Code Monkey V. 0.9
|
|
Join Date: Mar 2005
Location: A Land Down Under
|
|
|
What exactly "used to be different"?
|

February 12th, 2013, 05:27 PM
|
 |
For POny!
|
|
Join Date: Apr 2012
Location: Amsterdam
|
|
|
pay close attention to what catacaustic said.
prototype.js & scriptaculous.js don't show the code (they have a src attribute)
the other script tag doesn't and thus kind of forced to have the actual JS inside the tags
|

February 12th, 2013, 06:34 PM
|
 |
A Change of Season
|
|
|
|
Previously I used to see only
Code:
<script type='text/javascript' src="scriptaculous/src/scriptaculous.js"></script>
|

February 12th, 2013, 06:54 PM
|
|
Contributing User
|
|
Join Date: Jun 2009
Posts: 313
  
Time spent in forums: 3 Days 15 h 8 m 41 sec
Reputation Power: 5
|
|
|
So, this is your code you are writing, and you didn't even add prototype.js?
|

February 12th, 2013, 08:25 PM
|
 |
Lost in code
|
|
|
|
|
As stated previously, if the script tags contains a src attribute then the body does not contain code. If the script tag does not contain a src attribute, then either the body contains code or the tag is useless. There is never any type of automatic conversion between the two methods.
If your code used to be different, it's because the code was changed. We can't tell you who changed it or why of course.
|
Developer Shed Advertisers and Affiliates
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Rate This Thread |
Linear Mode
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|