var content="& lt; Br>" +
"Location:" + + ", "+ Y + X" & lt; Br>" +
"Name:" + '& lt; Input type="text" id="txt1" value="https://bbs.csdn.net/topics/789"/& gt; "+" & lt; Br>" +
":" + '& lt; Input type="text" id="txt2" value="https://bbs.csdn.net/topics/&name"/& gt; "+" & lt; Br>" +
"Type:" + '& lt; Input type="text" id="txt3 value=https://bbs.csdn.net/topics/&name"/> "+" & lt; Br>" +
"States:" + '& lt; Input type="text" id="txt4" value="https://bbs.csdn.net/topics/+name+"/& gt; "+" & lt; Br>" +
"Note:" + '& lt; Input type="text" id="txt5" value=""/& gt; "+" & lt; Br>" + "& lt; Br>" +
'& lt; Input type="button" onclick="" value=" at https://bbs.csdn.net/topics//& gt;" "+" + "
'& lt; Input type="button" onclick="set ();" Submit value="https://bbs.csdn.net/topics/"/& gt; ';
The above several are characters in the value displayed in the text box, with no quotation marks are the same
CodePudding user response:
I currently write assignment statement on open information window function, the back of the open operation, such as the following code, the problem is the first time open after the text inside information window does not display the data, turn off the open will show again, how to realize the first open can read data? I try in the open window above operation error,, consult everybody a great god!function openInfo (content, e)
{
Var p=e. arget;
Var point=new BMap. Point (p.g etPosition (). The LNG, p.g etPosition (). The lat);
Var infoWindow=new BMap. InfoWindow (content, opts);
Map. OpenInfoWindow (infoWindow, point);
Document. The getElementById (" txt1 "). The value=https://bbs.csdn.net/topics/name;
Document. The getElementById (" txt2 "). The value=https://bbs.csdn.net/topics/num;
Document. The getElementById (" txt3 "). The value=https://bbs.csdn.net/topics/type;
Document. The getElementById (" txt4 "). The value=https://bbs.csdn.net/topics/status;
Document. The getElementById (" txt5 "). The value=https://bbs.csdn.net/topics/remark;
}
CodePudding user response:
I also met the same problem, on the custom form in the form controls such as input control,1: using the document. The getElementById (" title "). The value="https://bbs.csdn.net/topics/title";
2: then will the loaded into the var infoWindow=new BMap. The infoWindow (content);
3: map. OpenInfoWindow (infoWindow, point);
Problem, the infoWindow input control value on their abdomen