js中使用innerHTML中拼接程序,使用<c:if>标签的问题???

html-css05

js中使用innerHTML中拼接程序,使用<c:if>标签的问题???,第1张

c:if是在界面生成的时候进行编译,那会哪来的js变量呢,最好改成用js来拼接

<c:if test='${"+eval(deptno)+"==dept.DEPTNO }'>selected</c:if>

可以写成: deptno ==' ${dept.DEPTNO}'?'selected':''

点击原testPage.html文件,按F2,修改后缀名为.jsp保存后就变成jsp文件了。

html页面使用jsp标签需要把html文件变成jsp文件才可以的。

1、原来html代码如下:

<!DOCTYPE> 

<html> 

<head> 

<meta http-equiv="Content-Type" content="text/htmlcharset=UTF-8"> 

<title>测试html转换jsp</title> 

</head> 

<body> 

这是一个测试页面

</body> 

</html> 

2、直接在原html页面最顶端添加如下代码:

<%@ page language="java" contentType="text/htmlcharset=GB18030"

pageEncoding="GB18030"%> 

3、修改文件后缀名

点击原testPage.html文件,按F2,修改后缀名为.jsp保存后就变成jsp文件了。

JSP(全称Java Server Pages)是由Sun Microsystems公司倡导和许多公司参与共同创建的一种使软件开发者可以响应客户端请求,而动态生成HTML、XML或其他格式文档的Web网页的技术标准。

#include <stdio.h>

#include <math.h>

void fetch_str(char *str_in, char *str_out)

int main(){

char test[] = "<a>This is the <...>string</a>"

char result[256]

fetch_str(test, result)

printf("\ntest\t=%s\n", test)

printf("\nresult\t=%s\n",result)

return 1

}

void fetch_str(char *str_in, char *str_out)

{

char begin_str[] = "<a>"

char end_str[] = "</a>"

int index_end =0

int index_begin=0

int flag_begin =0

int flag_end =0

int str_index=0

int i

// to find the max index of str_in

while(str_in[str_index]!='\0')

{

str_index++

}

str_index--

//printf("%s %s", begin_str, end_str)

int count=0

while(str_in[count]!='\0')

{

// to find the begin index of the target string

if( flag_begin==0 &&count<=(str_index-2) )

{

if( str_in[count]==begin_str[0] &&str_in[count+1]==begin_str[1] &&str_in[count+2]==begin_str[2] )

{

flag_begin=1

index_begin=count+3

}

}

// to find the end index of the target string

//if( flag_end==0 &&count<=(str_index-3) )

if(count<=(str_index-3) )

{

if( str_in[count]==end_str[0] &&str_in[count+1]==end_str[1] &&str_in[count+2]==end_str[2] &&str_in[count+3]==end_str[3])

{

flag_end=1

index_end=count-1

}

}

count++

}

//printf("\nbegin_index=%d, end_index=%d\n", index_begin, index_end)

// to copy the target string to str_out

count=0

for(i=index_begini<=index_endi++)

{

str_out[count]=str_in[i]

count++

}

str_out[count]='\0'

return

}