Is there URLEncode function in Javascript ?

CK CK 3788 
Created at  
397 0 0

EncodeURI() is the answer.

and followings are the usage example:

<script type="text/javascript"><!--

  function MoveTab(txtObj, event)
  {
    var keyCode = event.keyCode ? event.keyCode : event.which ? event.which : event.charCode;
    if (keyCode == 13) do_search();
  }

  function do_search()
  {
    if (document.getElementById("keyword").value)
    {
      self.location = "http://reportbank.com/s_" + EncodeURI(document.getElementById("keyword").value);
    }
  }
-->
</script>
<div width="100%" align=center>
  <font size=+6><strong>ReportBank</strong></font><br>
  <br>
    <input type=text id=keyword name=keyword size=20 value="<?=$keyword?>" onkeypress="return MoveTab(this, event)">
    <input type=button value=" Search " onclick="javascript:do_search()">
  <br>
</div>

Tags HTML Javascript URL Encode URL Encoding URLEncode formatted date Facebook X
Comments 0
Similar posts
  1. Move window
    551
  2. How to calculate page loading time ?
    360
  3. Number Of Vists
    520
  4. Add Message On Mouse Traling
    2,566
  5. Tooltip
    409
  6. Document Fader
    348
  7. Book Mark This Site
    409
  8. Icon Coupled Url
    429
  9. Button That Will Close The Browser Window
    354
  10. Button That Will Show The Page's Source
    391
  11. Add A Scrolling Status Bar Text To Your Site
    411
  12. Add This Page To Favorites
    407
  13. Code To Clear Browser History
    378
  14. Remove the spaces before begin and after end of text
    342
  15. How To Close A Pop-up Window ?
    451
  16. Pop Up Window On Top
    524
  17. How to display message on browser status bar ?
    482
  18. New Window
    613
  19. Color Table
    371
  20. Cursor Changer
    387
  21. Dual Scroller
    335
  22. Enlarge Image
    518
  23. Confirm The Link Clicked
    632
  24. Select And Deselect All Checkboxes By Javascript
    634
  25. Javascript Mouse Event Handler Example
    404
  26. Getting WebSearchers On Your Site
    378
  27. Hiding HTML on the browser
    469
  28. How to get date time in Javascript ?
    503
  29. Javascript based Alarm Clock
    680
  30. Javascript implemented Calendar
    425
  1. Javascript Confirmation
    598
  2. Javascript Prompts
    456
  3. How to know browser version in javascript ?
    449
  4. How to know the browser name in Javascript ?
    641
  5. Select All, None, Invert checkbox
    509
  6. Simple RSS Reader based on javascript
    503
  7. How to find the ip address of a client machine from a web application?
    519
  8. Put Date Time on HTML
    556
  9. IFRAME Auto Resize in IE, FireFox by Javascript
    461
  10. How to elimiate the "Restore Previous Session" dialog when FireFox 2.0 starts
    412
  11. How to include Javascript from anonther ?
    415
  12. Javascript based Browser Sniffing
    436
  13. Javascript based Regular Expression Tester
    378
  14. Two useful string functions - substr & substring
    413
  15. How to block a connection from the certain site ?
    358
  16. Firefox Web Tweaking
    382
  17. Send An Email Using A Bean
    1,022
  18. jQuery and Function Chaining
    542
  19. Basic Date Display
    518
  20. Address Book
    581
  21. Displays the number of pages that the users browser has displayed in its session
    671
  22. Greeting For The Time Of Day
    395
  23. Access Granted
    594
  24. Cookie enabled browser checking in Javascript
    345
  25. Cookie Redirect
    506
  26. New content notifier in Javascript
    606
  27. Let popup once for event dialog or something like that in Javascript
    428
  28. Save And Restore Form Cookies in Javascript
    340
  29. How to record visitor's name by Cookie
    414
  30. Javascript & Cookie based Visitor Application
    440
Recently updated
  1. Google OAuth Token Expiration: Causes and Solutions
    31
  2. Why 100% SEO Guarantees Better User Engagement and How to Achieve It in Your Service
    57
  3. Why SPF and DKIM Are Essential for Linux Email Servers?
    51
  4. How do I create animated background for Google Meet?
    23,254
  5. MaxMind GeoLite2 vs. DB-IP Lite vs. ip-api.com: Choosing the Right Free IP Geolocation Solution
    273
  6. Meet Valkey: Why Redis Changed Its License, Why Valkey is Better, and How to Use It as a Drop-in Replacement
    104
  7. How Rogue Web Scrapers Are Stealing My Content and Destroying My Server
    170
  8. Array of arguments passed to script in PHP
    99
  9. Invalid Auction Storms in Ad Tech
    107
  10. Building MRC-Compliant Instrumentation in Ad Tech: Implementation Steps and Key Challenges
    209
  11. The Two Clocks of Ad Server Architecture
    78
  12. Frequency Cap Architecture Overview
    527
  13. Collecting Proof-of-Play from 100,000 Screens
    153
  14. Vector Search in Relational Databases (RDBs): Trends & Usage Environments
    303
  15. What is RedisVL?
    117
  16. Designing a Skill Registry Architecture: Minimize Token Usage and Maximize AI Performance
    247
  17. TPU & GPU Cluster Management Tools
    258
  18. The Concept of Scaffolding in AI Agents
    245
  19. Beyond Static Pipelines: Architecting LLM Multi-Agent Systems for Autonomous Workflow Orchestration
    598
  20. AI-DLC vs. AI-SDLC: Model-Centric vs. System-Centric AI Development
    269
  21. Fine-Tuning Open-Weight LLMs: Training, Licensing, and Deploying Custom Models with Ollama
    355
  22. Inside the Next-Generation Streaming Architecture: Ultra-Low Latency, SGAI, and AI Codecs
    207
  23. Machine Learning: Training vs. Ranking
    230
  24. The Continuous Learning Machine: Designing a Loop That Actually Turns
    229
  25. The Next-Gen Low-Latency Standards: LL-HLS & MoQ
    204
  26. Designing a Data Curation System Around a Vector Database
    230
  27. Extracting Context from Live Video: The Architecture Got Simpler When We Stopped Building Features
    263
  28. The New Ad Stack Behind Live Sports Streaming: Inside SGAI, EABN, and the Standards Race to Fix Live Monetization
    674
  29. Designing MLOps Architectures to Handle Seasonal Data Drift in EV Fleet Models
    201
  30. From 15 to 40+ FPS: Accelerating PyTorch Object Detection on Automotive ECUs
    233