Menu

How to get query string values in JavaScript?

Using JavaScript now its very easy to get the URL parameters or query parameters or query string using window object. Below is the sample code snippet of reading the URL parameters.

For example we are accessing the below URL where we have two URL parameters present, and we want to read the source and location values from given or any URL.

https://javascript.jorvee.com/geturlparams.html?source=blog&location=javadeveloper

const urlParams = Object.fromEntries(new URLSearchParams(window.location.search).entries());

 

All the URL parameters are now present as an object in urlParams constant. Now to access any url parameter, just access using urlParams.<name of the parameter>. 
e.g. var urlSource = urlParams.source;

Here, source is a url parameter and it will return "blog" as source value.


Learn JavaScript Free | URL parameters and query String
JavaScript


Module not found error in ReactJS application

Issue:

ModuleNotFoundError: Module not found: Error: Can't resolve '../../../public/page-data/sq/d/3428351200.json' in 'C:\git\gatsby-starter-hello-world\src\components\City'


failed Re-building development bundle - 0.215s

ERROR in ./src/pages/index.js?export=default 6:0-44

Module not found: Error: Can't resolve '/components/City/City.js' in 

'C:\git\gatsby-starter-hello-world\src\pages'


Resolution: 

The import statement for City component is not correct, please put the correct path of the React component.  

Prominent people who converted to Islam

There have been many prominent people throughout history who have converted to Islam, from all walks of life and various parts of the world. Here are some examples:

  1. Malcolm X - An American civil rights leader who converted to Islam while in prison and became a prominent figure in the Nation of Islam.
  2. Muhammad Ali - A legendary American boxer who converted to Islam and became a member of the Nation of Islam.
  3. Cat Stevens/Yusuf Islam - A British singer-songwriter who converted to Islam in the late 1970s.
  4. Jermaine Jackson - An American musician and former member of the Jackson 5 who converted to Islam in the 1980s.
  5. Keith Ellison - An American politician who converted to Islam in college and became the first Muslim member of the U.S. Congress.
  6. Amr Khaled - An Egyptian televangelist who has been credited with inspiring a resurgence of interest in Islam among young people in the Arab world.
  7. Dr. Jeffrey Lang - An American academic and author who converted to Islam in the 1980s and has written extensively about his experience.
  8. Yusuf Estes - An American preacher who was raised in a Christian family and converted to Islam in the 1990s.
  9. A.R. Rahman - An Indian musician and composer who converted to Islam in the early 2000s.
  10. Sinead O'Connor/Shuhada' Davitt - An Irish singer-songwriter who converted to Islam in 2018.
  11. Kareem Abdul-Jabbar - A retired American basketball player who converted to Islam in the 1960s and has been a vocal advocate for the religion ever since.
  12. Dr. Maurice Bucaille - A French doctor and author who converted to Islam after studying the Quran and comparing its scientific teachings to modern science.
  13. Yusuf Islam/Cat Stevens - A British singer-songwriter who converted to Islam in the late 1970s and has since become a prominent Muslim philanthropist and peace activist.
  14. Hamza Yusuf - An American Islamic scholar who converted to Islam in the 1970s and is known for his contributions to the field of Islamic studies and interfaith dialogue.
  15. Amina Wadud - An American scholar of Islam who converted to the religion in the 1970s and is known for her advocacy of women's rights within the Muslim community.
  16. Shaquille O'Neal - A retired American basketball player who converted to Islam in the 2010s and has been a vocal advocate for the religion ever since.
  17. Mike Tyson - A retired American boxer who converted to Islam while serving a prison sentence in the 1990s and has since embraced the religion as a guiding force in his life.
  18. Ibtihaj Muhammad - An American Olympic fencer who converted to Islam in the 2000s and has become a role model for young Muslim women around the world.
  19. Dr. Ingrid Mattson - A Canadian Islamic scholar who converted to Islam in the 1980s and is known for her advocacy of interfaith dialogue and social justice.
  20. Jermaine Cole/J. Cole - An American rapper who converted to Islam in the 2010s and has incorporated Islamic themes and teachings into his music.
  21. Zainab Salbi - An Iraqi-American women's rights activist and author who converted to Islam in the 1990s.
  22. Lauren Booth - A British journalist and sister-in-law of former British Prime Minister Tony Blair who converted to Islam in 2010.
  23. Ellen Burstyn - An American actress who converted to Islam in the 1970s and has been a vocal advocate for the religion ever since.
  24. Diam's - A French rapper and singer who converted to Islam in the 2000s and has since become known for her religiously-themed music.
  25. Dave Chappelle - An American comedian and actor who converted to Islam in the 1990s and has been open about his faith in his comedy.
  26. Janet Jackson - An American singer and actress who converted to Islam in the 2010s and has been seen wearing traditional Muslim dress in public.
  27. Muhammad Asad - A Jewish-Austrian journalist who converted to Islam in the 1920s and went on to become a renowned Islamic scholar and translator of the Quran.
  28. Yusuf al-Qaradawi - An Egyptian Islamic scholar who converted to Islam in the 1940s and is known for his extensive writings on Islamic law and theology.
  29. Kristiane Backer - A German television presenter who converted to Islam in the 1990s and has since become a prominent Muslim spokesperson in Europe.
  30. Keith Ellison - An American politician who converted to Islam in college and became the first Muslim member of the U.S. Congress.
  31. Yvonne Ridley - A British journalist who converted to Islam after being captured by the Taliban in Afghanistan in 2001.
  32. Ahmed Deedat - A South African Islamic preacher who converted to Islam in the 1940s and is known for his debates with Christian evangelists.
  33. Michael Wolfe - An American writer and filmmaker who converted to Islam in the 1980s and has since written extensively about his experience.
  34. Lupe Fiasco - An American rapper who converted to Islam in the 2000s and has incorporated Islamic themes and teachings into his music.
  35. Maurice Copeland - An American actor who converted to Islam in the 1970s and has since appeared in a number of Islamic-themed films.
  36. Bilal Philips - A Jamaican-Canadian Islamic scholar who converted to Islam in the 1970s and has written extensively on Islamic theology and jurisprudence.
  37. Kristiane Backer - A German television presenter who converted to Islam in the 1990s and has since become a prominent Muslim spokesperson in Europe.
  38. Muhammad Wilkerson - An American football player who converted to Islam in the 2010s and has been open about his faith in interviews.
  39. Felixia Yeap - A Malaysian model and actress who converted to Islam in 2014 and has since become an Islamic fashion icon.
  40. Rosmah Mansor - The former First Lady of Malaysia who converted to Islam after marrying the country's former Prime Minister, Najib Razak.
  41. Jemima Goldsmith - A British socialite who converted to Islam in the 1990s after marrying Pakistani cricketer and politician Imran Khan.
  42. Isabelle Eberhardt - A Swiss explorer and writer who converted to Islam in the late 19th century and lived in Algeria, where she became a prominent advocate for Algerian independence.
  43. Mohamed Salah - An Egyptian football player who converted to Islam in his youth and is known for his devotion to the religion.
  44. Yvonne Haddad - An American scholar of Islam who converted to the religion in the 1970s and is known for her research on the Muslim diaspora in North America.
  45. Bernard Lewis - A British-American historian who converted to Islam in the 1930s and went on to become one of the world's leading scholars of the Middle East.
  46. Khabib Nurmagomedov - A retired Russian mixed martial artist who converted to Islam in his youth and has been open about the role of the religion in his life and career.
  47. Keith Moore - A Canadian embryologist who converted to Islam after studying the scientific accuracy of the Quran's descriptions of fetal development.
  48. Yahiya Emerick - An American author who converted to Islam in the 1980s and has written numerous books on Islamic history, theology, and spirituality.
  49. Francisco Javier Martínez - A Spanish former bishop who converted to Islam in the 2010s and has since become a vocal advocate for interfaith dialogue.
  50. Rumi - A 13th-century Persian poet and mystic who converted to Islam and is regarded as one of the greatest spiritual figures in Islamic history.