I have a web application that is written in .asp when I hit on one of the web controls to allow me to upload a .pdf I keep getting the following error:
Line: 39
Char: 43
Error: Syntax Error
Code: 0
Here is my code that I am using. Line 39 is where the code var sCheckFlag = ""; is at:
<script language="JavaScript">
var sAction = "INSERT";
var sTitle = "INSERT";
var oControl;
var oSeletion;
var sRangeType;
var v_imgname = "";
var v_Title = "";
var v_Target = "";
var v_linkcolor = "";
var sCheckFlag = "";
var oControl = "window.dialogArguments";
if(oControl)
{
v_imgname = oControl.getAttribute("href",2) ;
alert(oControl.style.color);
alert(oControl.getAttribute("target")); ...adam
v_Title = oControl.title;
v_Target = oControl.target;
v_linkcolor = oControl.style.color;
if(v_Target == "" || v_Target == null)
v_Target = "Not set";
alert(oControl.style.color);
}
var parameters = new Array(); //adam send an array instead of one value!
function insert_document()
{
if (imgname.value == "") {
alert("Please choose a document");
return false;
}
parameters['href'] = imgname.value;
parameters['Title'] = Title.value;
if (Target.value == "Not set")
parameters['Target'] = ""
else
parameters['Target'] = Target.value;
parameters['linkcolor'] = linkcolor.value;;
alert(parameters['href']);
window.returnValue = parameters;
window.close();
}
function UploadSaved(sFileName){
imgname.value = sFileName;
}
function attr(name, value)
{
if (!value || value == "") return "" ;
return ' ' + name + '="' + value + '"' ;
}
function Check(t,n)
{
if(n==1) {
t.style.border = "1px solid #00107B";
t.style.background = "#F1EEE7";
}
else {
t.style.border = "1px solid buttonface";
t.style.background = "buttonface";
}
}
function Init()
{
if(v_imgname!= "")
{
imgname.value = v_imgname;
Title.value = v_Title;
Target.value = v_Target;
linkcolor.value = v_linkcolor;
s_linkcolor.style.backgroundColor = v_linkcolor;
}
}
function Setcolor()
{
var orginalcolor = s_linkcolor.style.backgroundColor;
if(orginalcolor==null){
var sColor=document.dlgHelper.ChooseColorDlg();
else
var sColor=document.dlgHelper.ChooseColorDlg(orginalcolor);
if(sColor!=null&&sColor!="")
sColor = sColor.toString(16);
if(sColor.length<6)
{
var sTempString="000000".substring(0,6-sColor.length);
sColor=sTempString.concat(sColor);
};
linkcolor.value='#'+sColor.toUpperCase();
s_linkcolor.style.backgroundColor=sColor;
}
return;
}
</script>
Does anyone see anything wrong with this?? Any help would be greatly appreciated. Thanks in advance!
Kelly
Line: 39
Char: 43
Error: Syntax Error
Code: 0
Here is my code that I am using. Line 39 is where the code var sCheckFlag = ""; is at:
<script language="JavaScript">
var sAction = "INSERT";
var sTitle = "INSERT";
var oControl;
var oSeletion;
var sRangeType;
var v_imgname = "";
var v_Title = "";
var v_Target = "";
var v_linkcolor = "";
var sCheckFlag = "";
var oControl = "window.dialogArguments";
if(oControl)
{
v_imgname = oControl.getAttribute("href",2) ;
alert(oControl.style.color);
alert(oControl.getAttribute("target")); ...adam
v_Title = oControl.title;
v_Target = oControl.target;
v_linkcolor = oControl.style.color;
if(v_Target == "" || v_Target == null)
v_Target = "Not set";
alert(oControl.style.color);
}
var parameters = new Array(); //adam send an array instead of one value!
function insert_document()
{
if (imgname.value == "") {
alert("Please choose a document");
return false;
}
parameters['href'] = imgname.value;
parameters['Title'] = Title.value;
if (Target.value == "Not set")
parameters['Target'] = ""
else
parameters['Target'] = Target.value;
parameters['linkcolor'] = linkcolor.value;;
alert(parameters['href']);
window.returnValue = parameters;
window.close();
}
function UploadSaved(sFileName){
imgname.value = sFileName;
}
function attr(name, value)
{
if (!value || value == "") return "" ;
return ' ' + name + '="' + value + '"' ;
}
function Check(t,n)
{
if(n==1) {
t.style.border = "1px solid #00107B";
t.style.background = "#F1EEE7";
}
else {
t.style.border = "1px solid buttonface";
t.style.background = "buttonface";
}
}
function Init()
{
if(v_imgname!= "")
{
imgname.value = v_imgname;
Title.value = v_Title;
Target.value = v_Target;
linkcolor.value = v_linkcolor;
s_linkcolor.style.backgroundColor = v_linkcolor;
}
}
function Setcolor()
{
var orginalcolor = s_linkcolor.style.backgroundColor;
if(orginalcolor==null){
var sColor=document.dlgHelper.ChooseColorDlg();
else
var sColor=document.dlgHelper.ChooseColorDlg(orginalcolor);
if(sColor!=null&&sColor!="")
sColor = sColor.toString(16);
if(sColor.length<6)
{
var sTempString="000000".substring(0,6-sColor.length);
sColor=sTempString.concat(sColor);
};
linkcolor.value='#'+sColor.toUpperCase();
s_linkcolor.style.backgroundColor=sColor;
}
return;
}
</script>
Does anyone see anything wrong with this?? Any help would be greatly appreciated. Thanks in advance!
Kelly