Conditional Redirect Script Implementation
Budget / Salary₹12,500–37,500
TypeFreelance project
LocationRemote
Posted3 hours ago
I’m building a small personal site and need a lightweight JavaScript solution that can watch what a visitor does and, when certain conditions are met, redirect them to a particular page on the same domain. I already have the basic HTML in place; your task is to add the front-end logic and slot it neatly into my existing markup.
The redirection must be:
• Conditional – triggered by specific user actions I’ll outline (e.g., clicking a button, finishing a quiz, or reaching a time threshold).
• Internal – always pointing to a named page within my site, never off-site.
• Smooth – no screen flash or noticeable delay.
Deliverables
1. A commented .js file (vanilla JavaScript is preferred, though a clean jQuery snippet is acceptable) that:
• Detects the agreed user events
• Performs the redirect with window.location or the History API
• Includes graceful fallback in case JavaScript is disabled
2. Any minimal HTML hooks or data-attributes you need to add to my existing pages, clearly marked so I can drop them in.
3. A short README explaining where to place the script, how to tweak the conditions, and how to change the destination URL later.
Acceptance criteria
• All specified triggers reliably redirect to the correct internal page in Chrome, Firefox, Safari, and Edge.
• No console errors on load or during interaction.
• Code remains under 5 KB after minification.
The job is straightforward: craft clean, well-documented code that I can easily maintain. If you’ve built similar conditional routing or redirect logic before, that’s exactly the experience I’m after.
The redirection must be:
• Conditional – triggered by specific user actions I’ll outline (e.g., clicking a button, finishing a quiz, or reaching a time threshold).
• Internal – always pointing to a named page within my site, never off-site.
• Smooth – no screen flash or noticeable delay.
Deliverables
1. A commented .js file (vanilla JavaScript is preferred, though a clean jQuery snippet is acceptable) that:
• Detects the agreed user events
• Performs the redirect with window.location or the History API
• Includes graceful fallback in case JavaScript is disabled
2. Any minimal HTML hooks or data-attributes you need to add to my existing pages, clearly marked so I can drop them in.
3. A short README explaining where to place the script, how to tweak the conditions, and how to change the destination URL later.
Acceptance criteria
• All specified triggers reliably redirect to the correct internal page in Chrome, Firefox, Safari, and Edge.
• No console errors on load or during interaction.
• Code remains under 5 KB after minification.
The job is straightforward: craft clean, well-documented code that I can easily maintain. If you’ve built similar conditional routing or redirect logic before, that’s exactly the experience I’m after.
Apply on Freelancer →
Project sourced from Freelancer.com. Applications happen directly on the original platform — we never collect your data.