Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

219
Views
Cómo añadir "?" en cadena al enviar el formulario con js?

Escribo un hilo de envío de formulario con el método attr:

 var href = a.attr('href'); if(href =='') return; if(href.startsWith('http') || href.startsWith('//:')){ a.attr('href',href.trim()); if(href.indexOf(location.hostname) > -1){ return; } if(href.indexOf('<?php echo $_SERVER['SERVER_NAME']; ?>') > -1){ return; } a.attr('href','go.htm?uri='+href); a.attr('rel','nofollow'); }

Sin embargo, devuelve la URL sin ?, por ejemplo, quiero devolver https://example.abc.com/?ref=abc , el resultado devuelto será https://example.abc.com/ref=abc sin "?" el signo de interrogación

Estoy luchando para resolver esto y agradezco cualquier consejo útil.

about 4 years ago · Santiago Gelvez
1 answers
Answer question

0

Puede usar la cadena de función dividida. Divide tu URL con "?" y tomar el primer elemento.

 var yourRequiredLink = href.replace("?", '')
about 4 years ago · Santiago Gelvez Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!