Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script type="text/javascript">
- // Lots of code removed here!
- var options={
- method: 'get',
- parameters: 'inCatName='+ele.value,
- onSuccess: function(xhr) {
- // Find the categories <div>
- var divCategories=document.getElementById('divCategories');
- // Add the newly created category to the categories <div>
- divCategories.innerHTML+='<p>'+ele.value+'</p>';
- },
- onFailure: function(xhr) {
- // ...
- }
- };
- // More missing code...
- </script>
- <!--
- This is the categories loaded from the database when the page first loaded.
- It's been wrapped in <div> so that the Javascript can alter it
- -->
- <div id="divCategories">
- <p>Category 1</p>
- <p>Category 2</p>
- </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement