search

Home  >  Q&A  >  body text

Hello teacher, what does the question mark mean? And the following ?pid="+pid

Hello teacher, what do the question marks after html and pid = pid mean?

window.location.href="suorg/index.html?pid=" pid

TimeTime2107 days ago1747

reply all(3)I'll reply

  • Ennio

    Ennio2019-02-21 22:10:39

    href itself is a hypertext and a special string, so a string needs to be constructed. However, if the HTML statement is not placed in <prepare></prepare>, the spaces in the middle will be ignored. Equivalent to suorg/index.html?pid= If you replace the question mark with a space, the browser will ignore the space, so the link will be incorrect. You need to use a question mark to replace the space, or use   instead.

    The +pid behind it means that the value of the pid variable is regarded as a string and concatenated with the previous string to form a link, which is equivalent to linking to the specified website and passing in a default value.

    Beginners, although this is a simple question, I may be wrong or not rigorous in some places, please discuss more, hahaha

    reply
    0
  • Time

    Thank you very much for your answer! Thanks

    Time · 2019-02-22 10:27:35
  • Cancelreply