GetSimple Support Forum

Full Version: Edit components
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi everybody,
I am facing an unexpected problem. I created a new component - OK. Then I put a JS script in there an GS refuses to save it.
You don't have permission to access /get/admin/components.php on this server. The script is:
 <script>



var before="Something before"
var current="Something after"
var montharray=new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec")

function countdown(yr,m,d){
theyear=yr;themonth=m;theday=d
var today=new Date()
var todayy=today.getYear()
if (todayy < 1000)
todayy+=1900
var todaym=today.getMonth()
var todayd=today.getDate()
var todayh=today.getHours()
var todaymin=today.getMinutes()
var todaysec=today.getSeconds()
var todaystring=montharray[todaym]+" "+todayd+", "+todayy+" "+todayh+":"+todaymin+":"+todaysec
futurestring=montharray[m-1]+" "+d+", "+yr
dd=Date.parse(futurestring)-Date.parse(todaystring)
dday=Math.floor(dd/(60*60*1000*24)*1)
dhour=Math.floor((dd%(60*60*1000*24))/(60*60*1000)*1)
dmin=Math.floor(((dd%(60*60*1000*24))%(60*60*1000))/(60*1000)*1)
dsec=Math.floor((((dd%(60*60*1000*24))%(60*60*1000))%(60*1000))/1000*1)
if(dday==0&&dhour==0&&dmin==0&&dsec==1){
document.forms.count.count2.value=current
return
}
else
document.forms.count.count2.value="Remains "+dday+ " days, "+dhour+" hours, "+dmin+" minutes, and "+dsec+" second to "+before
setTimeout("countdown(theyear,themonth,theday)",1000)
}
countdown(2025,05,08)
</script>
What shal i du to
I understand that allowing scripts in the components breaks the security, but after all its my security.
For the site I am creating (with your help) this countdown script is vital. Gimme some advice, please.
you are probably being blocked by a security filter, server side or browser side, to prevent reflected xss injectkon.
I guessed so too, but
how can I avoid it?