How can I get the email address from a URL to appear on my webpage with javascript or HTML with a website built on Ruby on Rails?
I have a URL like this:
http://dance.danceninjas.com/thanks-so-good?cf_uvid=1ce505f1e32477b73a15a514962e25b2&email=test324@gmail.com
And I want to pull the email address from the URL into the webpage so I can say:
Please verify your email is correct:
<EMAIL_HERE>
I know that with WordPress I would use the PHP code:
echo $_GET["email"];
But apparently that won't work with websites built with Ruby on Rails.
I am using ClickFunnels to build my website, which means I have the ability to add Javascript into my footers and add snippets of custom HTML code.
Does anyone know how I can accomplish this?
If I understand correctly, ClickFunnels acts as a hosting and front-end construction platform that only gives you access to your page only through:
There's nothing Rails-specific you can use here. That would imply a lot of potential for security breaches. Execution of arbitrary Ruby can be done right, it's just rarely needed and thus rarely done.
That said, PHP-like solutions such as $_GET["email"];
won't work by principle. @rorofromfrance's answer has its right sides, but you can't make use of this because you don't own the platform and you can't modify the templates . It's not bad service design , there are some big advantages of this, the biggest of which is caching : a static page without any server-side processing can be placed in cache entirely and served through a CDN that can handle crazy amounts of traffic and stay up.
SO the solution is offloading that action for the client's browser. You pass parameters in a query string . This string is accessible through JavaScript ( window.location.search
), in raw format, like:
"cf_uvid=1ce505f1e32477b73a15a514962e25b2&email=test324@gmail.com"
That said, it should be split into keys and values before being used. And there are plenty of solutions for this under this question . Pick the one you like most.
您将需要使用Ruby语言(如果可以),然后将允许您访问如下URL参数:
params[:email]
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.