javascript URL和传递参数以及HTML超链接

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了javascript URL和传递参数以及HTML超链接相关的知识,希望对你有一定的参考价值。

//Server Side to get URL of current instance
gs.getProperty('glide.servlet.uri')

//Server Side, create HTML to navigate to a specific table item record"u_itgom_boards" is a name of a specific table.
"<a href='" +gs.getProperty('glide.servlet.uri') + "/u_itgom_boards.do?sys_id=" + current.u_task.sys_id.toString() + "'>

//Client Side - Set redirect URL to a new record with a specific view
action.setRedirectURL('table.do?sys_id=-1&sysparm_view=my_new_view);

//Client side - URL to create new record with request type field value set
var requestType = '^u_request_type=PAR';
var demandId = '&sysparm_query=u_demand_identifier='+current.sys_id;
var url = gs.getProperty('glide.servlet.uri') +'u_itgom_prog_board.do?sys_id=-1'+demandId + requestType;

//Get the current URL Client Script side:
alert(top.location);


//Get a parameter value from URL
//e.g. var myparm = getParameterValue('sysparm_category');
function getParameterValue(name) {  
    name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]");  
    var regexS = "[\\?&]" + name + "=([^&#]*)";  
    var regex = new RegExp(regexS);  
	alert("onChange:" + top.location);
    var results = regex.exec(top.location);  
    if (results == null) {  
        return "";  
    } else {  
        return unescape(results[1]);  
    }  
}

function getParmVal(name){
	alert("line 11");
	var url = document.URL.parseQuery();
	if(url[name]){
		alert("line14");
		return decodeURI(url[name]);
	}
	else{
		alert("line18");
		return;
	}
}

以上是关于javascript URL和传递参数以及HTML超链接的主要内容,如果未能解决你的问题,请参考以下文章

JavaScript中url 传递参数(特殊字符)解决方法

Jquery跳转页面传递参数以及获取url的参数

如何使用 javascript 将外部链接作为 url 参数传递? [复制]

javascript 传递参数中带加号自动变成了空格

Html中怎么把url传递过来的参数放在一个p标签中?

javascript实现页面跳转功能,参数怎么传递?