我的js代码在Chrome和IE中运行良好,但在Firefox中,控制台说:
TypeError:xmlDoc.getElementsByName不是函数
var nextSectionName = actSection.getElementsByTagName("clickArea")[actClickArea].getAttribute('linkTo');
actSection = xmlDoc.getElementsByName(nextSectionName)[0];
xmlDoc只是一个XML文件,actSection = xmlDoc.getElementsByTagName("section")[0];
也可以。
答案 0 :(得分:1)
您从Content text may be placed in a "content" member
了解的某些属性仅存在于HTML documents上,而不是XML documents上。其中包括#include <stdio.h>
#include <stdlib.h>
unsigned int createArray(float*);
void printArray(float *, unsigned int);
int main(){
float *pArray = NULL;
unsigned int arrayLength = 0;
arrayLength = createArray(pArray);
printArray(pArray, arrayLength);
return 0;
}
/**
* Ask the user to fill an array untill he types a negative value
*
* @param A pointer to the array we want to create
* @return The final length of the array
*
*/
unsigned int createArray(float *pArray){
float number = 1;
int arrayLength = 0;
while(number>0){
printf("\nSetting number %d: ", arrayLength);
scanf("%f", &number);
arrayLength++;
pArray=realloc(pArray, sizeof(float)*arrayLength);
if(pArray==NULL){
printf("\nERROR: Not enough memory");
free(pArray);
exit(0);
}
pArray[arrayLength-1] = number;
}
return arrayLength;
}
/**
* Prints an array given by the user
*
* @param Pointer to the array
* @param Length of the array
*
*/
void printArray(float *pArray, unsigned int arrayLength){
for(int i=0;i<arrayLength;i++){
printf("\nItem[%d]: %.2f", i, *pArray+i);
}
}
,window.document
,.referrer
或.head
等属性,以及.body
,.images
或.write()
等方法
在XML文档中,您应该只使用ID和类,.execCommand()
属性是没有意义的。如果绝对必须匹配名称,请使用属性选择器。