求教各位大神var url = "read.html?name="和"&password="是什么意思?
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8"/>
    <title></title>
    <script>
        function post() {
            var url = "read.html?name=" + escape(document.all.name.value);
            url += "&password=" + escape(document.all.password.value);
            window.location = url;
        };
    </script>
</head>
<body>

Name:<input type="text" name="name"/><br/>

Pass:<input type="text" name="password"/><br/>

<input type="button" value="post" onClick="post()"/>

</body>
</html> 

我还有一个read.html的文件,我知道大概就是调用read.html的意思,,但是如果想要吧这个post.html页面的JS和read.html中的JS合并,post.html中的JS代码该如何改动?

3个回答

你这个是拼接了一个url,就是登录名和密码,然后通过这个跳转到read.html页面
不知道你的合并用的是什么,你定义一个js页面,然后read.html和post.html分别引入这个js就行

liangayang
敲个锤子 回复reborn_tou: 之前在写代码,你试试看看好使不,百度百度
10 个月之前 回复
reborn_tou
reborn_tou 回复reborn_tou: 好的谢谢我试试
10 个月之前 回复
reborn_tou
reborn_tou 回复liangayang: read.html?可以不用改动吗?
10 个月之前 回复
reborn_tou
reborn_tou 回复liangayang: 我就是想写在外部然后引用,,这个我会,但是因为不知道这个JS是怎么引用post.html的,所有想知道如果这个两个JS函数放在同一个文件中的话,是不是就可以不用read.html?了?
10 个月之前 回复
liangayang
敲个锤子 回复reborn_tou: 把标签:<script></script>中的东西写到post.js中,然后read.html中引入post.js,function别重复
10 个月之前 回复
reborn_tou
reborn_tou 就是想简化代码,想把JS和HTML分离开来,read.html文件其实里面就是单纯的JS代码,然后想把post.html中的JS代码分离出去后跟post.html(post.js)合并
10 个月之前 回复
liangayang
敲个锤子 回复reborn_tou: 你是想吧哪个js放在read.html的哪个代码中,js写法现在一般分为2种,一种引入其他js页面,一种就是你这种写在script标签中
10 个月之前 回复
reborn_tou
reborn_tou 您好,请问如果要把这个JS函数放到read.html的那个代码中,这段代码该怎么改呢?直接删去read.html?就可以吗?
10 个月之前 回复

var url = "read.html?name="和"&password="是什么意思?
这个是url地址,带了参数,name="和" ,password="xxx"。就是你输入的用户名和密码。
看你代码的意识就是:点击一个按钮,然后js实现跳转页面。顺便把用户的名字和密码带过去。

qq_23126581
玄元复始道生初,守一无穷尽万物 回复reborn_tou: 你是想在read.html里取到你输入的用户名和密码吗?在页面写<% String name= request.getParameter("name"); ,String password= request.getParameter("password"); %>
10 个月之前 回复
reborn_tou
reborn_tou 您好,请问如果要把这个JS函数放到read.html的那个代码中,这段代码该怎么改呢?直接删去read.html?就可以吗?
10 个月之前 回复

拼接URL,传值过去

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
Var::Var() : name()是什么写法
Var是个类
求教各位大神!
在一个存储过程里面,要查询的库存是根据已有的数据生成的,而且每天都变化,请问怎么查出来?
菜鸟,求教各位大神!!!
[b]我在一个文本中写入1029,然后读取它,不知道为什么读取出来的内容是一样的,但是它们的内容和字符串序列一样呢?[/b]rn代码如下:rn [code=java] [color=#FF0000] File f=new File("配置.ini");rn FileReader fr=new FileReader(f);rn char cbuf[]=new char[1024];rn while(fr.read(cbuf)!=-1);rn port=String.valueOf(cbuf);rn fr.close();rn System.out.println(port);rn System.out.println(""+port.length());rn System.out.println(""+"1029".length());rn System.out.println(""+port.equals("1029"));[/color][/code]rn运行结果如下:rn[img=https://img-bbs.csdn.net/upload/201403/17/1395043460_868736.jpg][/img]
求教各位大神
[size=18px][color=#FF0000]50元求把一张frf格式的收银小票报表改为普通票据形式。[/color]rn也就是把下图:[/size]rn[img=https://img-bbs.csdn.net/upload/201511/30/1448891341_750644.jpg][/img]rn[size=18px]改为下图形式:[/size]rn[img=https://img-bbs.csdn.net/upload/201511/30/1448891405_728197.jpg][/img]rnrn[size=18px]联系QQ:1056886629rn如果有懂进销存、POS收银软件的,200元求另一个问题的解决rn[img=https://img-bbs.csdn.net/upload/201511/30/1448891939_526635.jpg][/img]rnrn[color=#0000FF]求版主不要再没有任何通知,随心删我的帖子了。我仔细研读了版规,也没有禁止这样的求助。再则,我这也是被逼无奈啊,而且这样的求助帖对论坛不会造成不良影响。版主仁心仁德,高抬贵手![/color][/size]
求教各位大神~~~~
环境:windows,vs2005rn语言: VCrnrn问题:我有一个头文件在一个工程里使用,我想然后以后所有新建的.cpp,.h文件都默认包含这个文件。该怎么弄呢?怎么设置呢?rnrn这个我现在就用到了。。我重载了new delete...想让我整个工程都使用我重新写的new delete .rn我可以包含头文件。。但是我无法保证别的人在我工程里加代码的时候也默认调用我的写的这些呀~~~rn
各位大神求教 PLS-00103
CREATE OR REPLACE PROCEDURE UP_GetHBBZByPagern @tblName varchar(255),rn @fldName varchar(255), -- 排序字段名rn @PageSize int = 10, -- 页尺寸rn @PageIndex int = 1, -- 页码rn @IsReCount bit = 0, -- 返回记录总数, 非 0 值则返回rn @OrderType bit = 0, -- 设置排序类型, 非 0 值则降序rn @strWhere varchar(1000) = '1=1' -- 查询条件 (注意: 不要加 where)rn ASrn declare @begin int ,@end int,@sql varchar(4000),@order varchar(5)rn set @begin=@PageSize* (@PageIndex-1) +1rn set @end=@begin+@PageSize-1rn set @order=''rn if(@OrderType=1)rn set @order=' desc'rn set @sql='rn select * fromrn (rn select ROW_NUMBER() over(order by ' + @fldName + @order +' ) as od,rn * from '+@tblName +' where ' + @strWhere + ') as tbl where od between ' + rtrim(ltrim(str(@begin)))+' and ' + rtrim(ltrim(str(@end)))rn exec (@sql)rn if(@IsReCount=1)rn exec('select count(*) from '+ @tblName+' where ' +@strWhere)rnrnrnrn错误 是 第二行rnrn @tblName varchar(255),rnrn 错误:PLS-00103: 出现符号 "@"在需要下列之一时:符号IS 在 @之前插入 是什么意思求解答rnrnrn
各位大神求教
void printlist(seqlist *&head)括号里面的*&head,无法理解。
杀进程的问题!!!!求教各位大神
[b][size=16px]小弟目前在做一个c#桌面应用程序“考试系统”,要求是;学生登陆后,程序立马杀光所有无关的进程,请问c#代码该如何实现??如何获取那些无关的进程???[/size][/b]rnrnrn求教各位大神了
tomcat服务器的一些问题求教各位大神
小白我,解压了toamcat的服务器的压缩包,在bin目录下启动了startup服务器,在浏览器中访问http://localhost:8080 进不去tomcat服务器的主页,我较为紧张。页面报错500,,,,这不应该啊求指教[img=https://forum.csdn.net/PointForum/ui/scripts/csdn/Plugin/001/face/35.gif][/img]
求教各位大神蓝牙连接的问题
新人初来乍到,想向各位大神请教关于蓝牙连接的问题,这是我的代码rnprivate void connectDevice(String address) rn final String SPP_UUID = "00001101-0000-1000-8000-00805F9B34FB";rn UUID uuid = UUID.fromString(SPP_UUID);rn BluetoothDevice device = adapter.getRemoteDevice(address);rn try rn socket = device.createRfcommSocketToServiceRecord(uuid);rn socket.connect();rn is = socket.getInputStream();rn readData();rn catch (Exception e) rn e.printStackTrace();rn// try rn// socket.close();rn// catch (IOException e1) rn// e1.printStackTrace();rn// rn if (isconnect) rn connectDevice(address);rn rn rnrn我是想连接蓝牙设备,如果那个设备没有开启,需要重新连接,直到那个设备开启后完成连接;但如果设备一直不打开,循环重连半小时之后会出现内存溢出的情况,出现在socket.connect()这里;后来想到可能时没有close,所以加上注释的那部分代码,结果还是没有解决问题;新人初来乍到,不知道这样发帖对不对
求教各位大神(手机号码生成)
求各位大神说下rn手机号开头为13/14/15/18的11位数字如何实现
求教各位大神一个问题
最近在做一个电商的支付功能,采用的是接第三方支付平台,然后通过三方平台的异步通知来更新订单状态。rnrn此时会有一个问题,就是这笔钱已经支付成功,并且第三方平台也发送了消息到我的异步通知方法中去,此时我会去更新订单的支付状态,但是如果这时数据库这边出现一些什么问题的话,这笔订单的状态就会更新失败,而钱却已经支付了,所以我想问下,如果出现这种问题有什么好的解决方案没有啊
求教各位大神,break语句。。
public class huang rnrn /**rn * @param argsrn */rn public static void main(String[] args) rn // TODO Auto-generated method stubrn int stop = 4;rn for(int i=0;i<=10;i++)rn rn if(i == stop)break;rn rn System.out.println("stop="+stop );rnrn rn rn rn rnrnrnrnrn为什么结果会是rnstop=4rnstop=4rnstop=4rnstop=4rn。。。。。rn而不是rnstop=1rnstop=2rnstop=3rn请教各位大神。
各位大神,求教一个问题!!!!!!!
下面的代码中哪里有错为什么Myeclipse9认为有错呢????rnrnrn全选rn取消全选rnrn错误提示为:Multiple annotations found at this line:rn - Attribute value (var array=document.getElementsByName('id');for(var i=0; i
var命令疑问求教
[code=html] rn rn [/code]rn为什么 a[6]() 输出结果是10,而b[6]输出结果是6?
调用URL的name
本系列课程是从零基础开始并深入讲解Django,最终学会使用Django框架开发企业级的项目。课程知识点全网最详细,项目实战贴近企业需求。本系列课程除了非常详细的讲解Django框架本身的知识点以外,还讲解了web开发中所需要用到的技术,学完本系列课程后,您将独立做出一个具有后台管理系统,并且前端非常优美实用的网站。对于从事一份Python Web开发相关的工作简直轻而易举。
URL的name属性
本系列课程是从零基础开始并深入讲解Django,最终学会使用Django框架开发企业级的项目。课程知识点全网最详细,项目实战贴近企业需求。本系列课程除了非常详细的讲解Django框架本身的知识点以外,还讲解了web开发中所需要用到的技术,学完本系列课程后,您将独立做出一个具有后台管理系统,并且前端非常优美实用的网站。对于从事一份Python Web开发相关的工作简直轻而易举。
window.open(url,name)里name怎么用?
如果要引用子窗口都会用rnvar p=window.open(url,name);rn然后通过p引用子窗口吧?rn那name怎么用?rn我记得刚学js时name只是新窗口名字而已啊?
求教 typeid .name
[code=c] const char* typeName = typeid().name();[/code]rn得到的类型名称识别的字符串指针 typeName;rn在程序运行起来后的任何时刻调用typeid().name()是否都是指向相同的地址?
求教如何改变 var值
要通过ajax传一个code值,默认是A,点击“点我”弹出对话框,提示 点“确认”继续 “取消”关闭。rn如何让点击确认按钮后,让code值变成“B”rn谢谢啦rn[code=HTML]rnrnrnrn rn 无标题文档rn rnrnrnrn点我rn rn rn rnrnrnrn[/code]
求教 var 和=>符号怎么用
var 和=>是什么意思 怎么用呢,谢谢
求教大神!
有人会用Jflap 模拟图灵机 , 实现开方运算吗? 有偿! 联系方式 QQ : 2970729572
大神求教
有谁清楚react native实现点击不同按钮渲染不同视图,其他地方包括背景不变,怎样实现,功能类似两种登录小按钮,不跳转,点击账号登录,或点击手机登录,求告知。...
求教大神!!!!
我经常看见有函数括号里面有node *&head或者node *headrn我看使用node *&head时候要重新分配空间,而node *head的时候不要,请教大神是不是rn这个样子的。解释一下原理啊!
求教大神!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
求教大神,我的俩个input ,value值是存在的,但一个可以获取,一个就无法获取。[img=https://img-bbs.csdn.net/upload/201811/26/1543223571_635139.png][/img][img=https://img-bbs.csdn.net/upload/201811/26/1543223577_916978.png][/img]
求教大神
小弟我需要建个投票系统,需要每点击提交一次时数据库对应选民的piaoshu列加1rnrn[img=https://img-bbs.csdn.net/upload/201305/16/1368687988_806497.jpg][/img]rnrn[code=html]<%@ Page Language="C#" AutoEventWireup="true" CodeFile="query.aspx.cs" Inherits="Default3" %>rnrn<%@ Register Assembly="Microsoft.ReportViewer.WebForms, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"rn Namespace="Microsoft.Reporting.WebForms" TagPrefix="rsweb" %>rnrnrnrnrnrn 无标题页rnrnrn rn rn rn rn rn rn rn rn rn rn rn rn rn <%# Eval("name") %>rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rnrn rn rn rn rnrnrn[/code]
大神求教!
MFC基于对话框编程,主对话框上面调用显示子对话框后,输入子对话框的可编辑控件数值,根据数值在子对话框上画曲线,但这时显示的确定按钮是主对话框上的。如何从主对话框上转到子对话框的OnPaint中?
关于迷宫的一个问题,求教各位大神。。
[b]Notes About Completion of this Assignment[/b]rn1. Although the result of completing this assignment will be an enjoyable program,rnthis is a programming assignment ― you will not be assessed on, for example,rnthe beauty of your room descriptions.rn2. You may develop your program on whatever computer you wish, but it may berntested by typing make on a UNIX system, and ./maze to run your program.rn[b]Part 1: Basic Functionality[/b]rnReplicate the supplied example program’s basic functionality.rnYou can play the example program by copying the provided file (maze) to your filespacernon dunk/manning. Ensure the file is executable (enter the command “chmod 755rnmaze”).rnAnd then play the game by typingrn./mazernMake sure that you can understand and finish the program. Explore the maze of roomsrnthoroughly, especially the mirror room, to understand how they function.rnNotes on the program:rn• Bugs in the example program need not be reproduced in your program, pleaserncontact your lecturer and inform them of the bug instead.rn• The only moves available are the directions n, s, e, w, and quit. There is no need tornimplement diagonal directions ne, sw etc.rnrnNotes on general implementation:rn• There is no requirement to implement maze (room configuration) saving andrnloading, the maze will be hard-coded, created in code at the start of your game.rn• To help with your testing don’t limit the number of player steps yet, wait until yourrngame is working properlyrn• Don’t worry about the Mirror Room yet, it will be done in part 2rn• You must not use a grid system, e.g. a multidimensional array, to store your roomsrnor connections. Please think of the caverns as different shaped rooms connected torneach other rather than as a grid.rn• You must not use any global variables in your program.rnrnrnBegin by creating a class [color=#C0C0C0]Room[/color]. One [color=#C0C0C0]Room[/color] object will represent 1 room of your maze.rnClass [color=#C0C0C0]Room[/color] will have at least:rn• a description that your program will show when the player enters the roomrn• a method [color=#C0C0C0]add_connection[/color] to connect neighboring roomsrn• a method [color=#C0C0C0]travel[/color] that is used for player movement between roomsrnrnrnMake sure that [color=#C0C0C0]room.h[/color] has a comment describing what the [color=#C0C0C0]Room[/color] class is for (samernapplies for any other classes you create).rnEach [color=#C0C0C0]Room[/color] object must be allocated with operator [color=#C0C0C0]new[/color]. (Don’t worry about deleting thernrooms until part 3 of the assignment.)rnrnWrite a function [color=#C0C0C0]create_maze[/color] in file [color=#C0C0C0]maze.cpp[/color] that creates your maze by makingrnrooms and connecting them. Include testing in the function that ensures that the roomsrnreally did connect up properly. Here is an example fragment of [color=#C0C0C0]create_maze[/color]:rnRoom * room1 = new Room("a large room");rnRoom * room2 = new Room("a narrow room");rn// going north from room1 leads the player to room2rn// (AddConnection should set both directions)rnroom1->add_connection(north, room2);rnmethod [color=#C0C0C0]add_connection[/color] must work as shown above, that is, it must use the syntaxrnabove and create a bidirectional connection between the rooms.rnCreate several interconnected rooms.rnThoroughly test your room connections before continuing with the assignment.rnWrite the body of your game, including getting commands from the player, and makernsure that the game is playable. Limit the number of steps i.e. make it possible for thernplayer to die. You may want to create other classes to take care of some aspects of therngame, the design is up to you.rnrnrnPart 2: More Complex Roomsrn• Implement class MirrorRoom so that rooms of this class perform the same way as inrnthe mirror room in the example program.rn• Invent and implement a class for another type of interesting room.rnDocumentation – [color=#C0C0C0]maze.doc[/color] or [color=#C0C0C0]maze.pdf[/color]: once you have a reasonably interestingrnmaze created (minimum 8 rooms, not the same as any other student’s maze) create arnpictorial map of your maze. This must be submitted along with your code. Also submit arnstring of commands that allow the player to successfully navigate the maze, and a stringrnof commands that leads to death e.g.rno Example success path: [color=#C0C0C0]nnenwse[/color]rno Example death path: [color=#C0C0C0]nnwneswneneneswnen[/color]rnrnrnPart 3: Finishing UprnYou should now have a fully functioning game that is easy to test. Part 3 will add somernprogramming niceties. Do not attempt these if parts 1, and 2 are incomplete!rnOverloaded OperatorsrnOverload the << operator in room so that the room description can be shownrnconveniently. Use this functionality in your main program.rnCleaning Up Memory AllocationrnAs described in part 1, your [color=#C0C0C0]Room[/color] objects should be allocated with new.rnAt this stage delete the rooms properly. This can be a complex task because the roomsrnare connected together in complex ways.rnrnrnAs a starting point, examine the following code fragment from a different program to givernyou ideas.rnPerson::~Person()rnrn// mark this Person object as deleted so that others don'trn// try to delete it againrnmarked_for_deletion = true;rn// delete friend People, unless they are alreadyrn// marked for deletionrnif (best_friend && !best_friend->marked_for_deletion) rndelete best_friend;rnrnif (second_best_friend && !second_best_friend->marked_for_deletion) rndelete second_best_friend;rnrncout << "Debugging: ~Person: deleted person " << name << endl;rnrnUse cout to print messages to show that the objects are being properly deleted (as inrnthe example program and the code fragment).rnrnSubmissionrnSubmit a single zip file called SurnameFirstname.zip containing all of your files.rnAt a bare minimum the files would be:rn• makefilern• maze.cpp – main program, must also include adequate testing of class Roomrnthrough assertionsrn• room.hrn• room.cpprn• program_transcript.txt screen capture of text showing that your game worksrn(see Appendix 1)rn• (files for any other objects you needed)rn• mirrorroom.h (inherited from room class)rn• mirrorroom.cpprn• boggyroom.h (inherited from room class)rn• boggyroom.cpprn• (plus files for another type of room)rn• maze.doc (or maze.pdf) containing:rno a map and explanation of your mazerno a path that leads to successrno a path that leads to deathrnrnrn求助啊 哪位大神会的一定救命啊。。。rn
一段代码看不懂,求教各位大神
[code=c]http_headers_container http_header_parser::parse_headers(std::string::const_iterator begin, std::string::const_iterator end)rnrn http_headers_container headers;rnrn auto is_digit = [](char ch) -> bool rn return '0' <= ch && ch <= '9';rn ;rn auto is_alpha = [](char ch) -> bool rn return ('a' <= ch && ch <= 'z') || ('A' <= ch && ch <= 'Z');rn ;rn auto is_token_char = [&is_alpha, &is_digit](char ch) -> bool rn return is_alpha(ch) || is_digit(ch) || (rn ch == '!' || ch == '#' ||rn ch == '$' || ch == '%' ||rn ch == '&' || ch == '\'' ||rn ch == '`' || ch == '*' ||rn ch == '+' || ch == '-' ||rn ch == '.' || ch == '^' ||rn ch == '_' || ch == '|' ||rn ch == '~');rn ;[/code][code=c] auto is_digit = [](char ch) -> bool rn return '0' <= ch && ch <= '9';rn ;[/code]这样的代码怎么理解?是C++11么?
MFC新手,求教各位大神一个问题
是这个样子,我之前是做linux下面的c++开发的,所以对MFC并不是很熟悉。最近工作需要我就使用了MFC。公司要求做一个多线程的程序,我现在写了两个类准备在线程中回调类的有元函数,但是我发现在MFC中并没有MAIN函数,我是想着把线程在程序执行一开始就运行,同时在main函数里加入一个等待,等待线程的执行完毕(以前使用c++是可以这么做)。所以我想再想的是,一般大家在使用MFC的时候遇到这种情况是怎么办的,如果我在界面上使用一个开始按钮和结束按钮来对程序进行控制,并在按钮的事件响应函数里进行我自定义的类的实例化以及启动线程,这样做好不好,会不会破坏面向对象的封装性。rn 求求各位大牛帮帮我[img=https://forum.csdn.net/PointForum/ui/scripts/csdn/Plugin/001/face/9.gif][/img]
各位大神求教啊,关于按键驱动
我在做一个项目,官方按键驱动有个bug 驱动在使用一段时间后,按键扫描后寄存器的数据已经被更改,但中断不产生。网上说最直接快的方案是产生添加一个定时器,定时去刷新中断寄存器。我想问一下各位大牛这个刷新中断寄存器是什么意思?计时关中断,开中断?rn小弟驱动一片茫然,还望各位大牛不吝赐教 感激不尽啊!
js中,$name('name')如何使用,求教
在如下代码中,手动添加代码,执行顺序为:先执行alert,再执行上面的那一坨代码,为什么?rn[img=https://img-bbs.csdn.net/upload/201705/03/1493779398_330864.jpg][/img]rnrn另外,$name('name')如何使用?
求教各位大神,MFC 对话框 问题
我建立了一个对话框程序。当在主页面点击按钮的时候进入 子页面,响应onclick,在此函数中隐藏主页面。然后在子对话框的返回按钮中,先将子页面隐藏,再将主页面showwindow(SW_SHOW),可是这样返回之后点击主页面就没反映了。rn求教应该怎样实现
求教各位VB大神,帮个忙
大概写一个小程序rn帮个忙,这一个程序,从文件中读取10个数,写入数组中,然后找出最大数的位置,然后用选择排序发降序排列写入文件中,大概这样,用VB写,麻烦大神,万分感谢,VB没学过
自定义控件的问题,急急急,求教各位大神
[img=https://img-bbs.csdn.net/upload/201508/30/1440900521_901999.png][/img]rnrn[img=https://img-bbs.csdn.net/upload/201508/30/1440900556_614534.png][/img]rnrn在R.java里面生成了layout的ID,但是在titlelayout类里找不到
相关热词 c# login 居中 c# 考试软件 c# 自然语言分析 c# 分段读取文件 c# 泛型反射 c#打断点 c# 时间转多少秒 c# 线程函数加参数 c# modbus 读取 c#查询集合表