Skip to content

Tag: javascript

Track how long a user stays on a page?

How can I track how long a user stays on a page before they request another or simply leave the site? Basically, I want to do a check, if a user stays on the page for 20 minutes or longer, then do something. I believe this would require php and javascript, but I am not exactly sure how to accomplish

Add radio button selection to database via ajax?

When I test my form it adds data successfully to my database table but the radio button selection is always “Ungrouped” which is the first radio button in the group. I tried giving them separate id’s, but in my ajax.js file my function uses this: Which means that now I am calling an id that …

How can I prevent javascript code theft?

Actually I’m developing a Chrome extension and a jQuery plugin to upload it and sell it on Codecanyon. When I “Inspect source” of the page and I click on the “Resources” tab, the javascript file looks empty. How does Codecanyon do that? I want to have file theft prevention in my …

Crop local image file

I got a form that allow user to upload image and crop it I already figured out the flow of it 1.User upload the image 2.Server process it and send back to the browser 3.User crop it and send to the server 4.Server process and save it Is there any other way to achieve this? Perhaps using javascript to load

JSONP with Laravel

Browser sends JSONP requets to Laravel, Laravel returns the results to browser. In the brower console, I get the warning: I believe this is due to improper headers in the JSONP response? How should this warning be fixed? PHP Response::JSON($result) will return the usual JSON response I believe, not the JSONP …