10 examples of 'change href jquery' in JavaScript

Every line of 'change href jquery' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your JavaScript code is secure.

All examples are scanned by Snyk Code

By copying the Snyk Code Snippets you agree to
this disclaimer
214function showHref(element) {
215 if (tempHrefs[element.attr('id')]) {
216 element.attr('href', tempHrefs[element.attr('id')]);
217 }
218}
Important

Use secure code every time

Secure your code as it's written. Use Snyk Code to scan source code in minutes – no build needed – and fix issues immediately. Enable Snyk Code

37function redirectbasehref(el, responseText) {
38 var mo = responseText.match(/<base href="(\S+?)"/i);
39 if (mo.length === 2) {
40 return mo[1];
41 }
42 return location;
43}
131function addHashIfNeeded(href) {
132 if (sniffer.history) {
133 return href;
134 }
135 var index = href.indexOf('#');
136 if (index===-1) {
137 return href+'#';
138 }
139 return href;
140}
48private _updateHref() {
49 let path = this._cleanUpHref(this._href);
50
51 this.linkHref = this._router.prepareExternalUrl(path, this._query);
52 this.hrefUpdated.emit(this.linkHref);
53}
196resolveHref(el) {
197 if (!el) {
198 return null;
199 }
200 const closestHrefEl = el.closest('[href]');
201 return closestHrefEl ? closestHrefEl.getAttribute('href') : null;
202}
27pushHref (href) {
28 window.location.hash = href
29}
43function SetBaseHRef( baseHref )
44{
45 var eBase = document.createElement( 'BASE' ) ;
46 eBase.href = baseHref ;
47
48 var eHead = document.getElementsByTagName( 'HEAD' )[0] ;
49 eHead.appendChild( eBase ) ;
50}
182function createHref(location) {
183 return createPath(location);
184}
84private updateHref(): void {
85 let {to, params} = this.props;
86
87 try {
88 this.href = to.$router.$(to, params).$href();
89 } catch (error) {
90 this.href = 'javascript:;';
91 }
92}
76function createHref(location) {
77 return history.createHref(resolveLocation(location));
78}

Related snippets