Jump to content

jesh

Members
  • Posts

    2,293
  • Joined

  • Last visited

Everything posted by jesh

  1. You said that you changed the post value from "dir" to "file_name". Did you also change that in the javascript?
  2. jesh

    Get option text

    If you are using javascript on the client-side, you might try a hidden input that stores the text of the selected item and populate that data using java script: <select id="myselect" onchange="updateHidden(this);"> <option value="-1">Select an Option</option> <option value="1">Value 1</option> <option value="2">Value 2</option> <option value="3">Value 3</option></select><input type="hidden" id="h_myselect" value="-1" /><script type="text/javascript">function updateHidden(obj){ var theText = obj.options[obj.selectedIndex].text; document.getElementById("h_myselect").value = theText;}</script> But, as you well know, I don't know anything about CF nor whether it is possible to integrate javascript with it like this. Maybe it'll help.
  3. I wouldn't suggest setting the EnableViewState to false globally for all of your pages unless you have a different MasterPage for pages which need to be posted back to the server. Rather, I would suggest setting the EnableViewState="false" for each individual control.Even with ViewState turned off for the entire page or for every control, I think .NET still puts that token ViewState on the page. I don't know the answer to why it does that.
  4. Can you post the code for showfile.inc?
  5. Yes. This link should help. Read the 4th or 5th post down.http://forums.devshed.com/flash-help-38/fl...-div-64464.html
  6. IE has some funky security settings in place when you load an html file locally. This could be the cause of your issues.
  7. jesh

    problem with date()

    Shouldn't "or" be "||" like the following?else if (($theme_switch_hour>=0 && $theme_switch_hour<7) || ($theme_switch_hour>=20 && $theme_switch_hour<23)) EDIT: Sorry Kristian_C, I glazed over your response and didn't see that you said the same thing.
  8. jesh

    PHP Auth

    Keep in mind that IP addresses can change if a person is assigned a dynamic IP address each time s/he connects to the Internet or a person uses a different computer to access the site (e.g. home vs. work). Also keep in mind that many organizations are behind proxy servers where all computers in that network share a single external IP address to the Internet. In those instances, you may see multiple people logged into your site from the same IP address using different accounts.
  9. I haven't begun playing around with MasterPages yet so I can't be of much help there. However, some of the page size is because of the ViewState. You've got a number of controls in the MasterPage that have runat="server". When a control is run at server, a ViewState is saved for that control so that when the page is posted back to the server, the server can remember what the data in the control was. Your current ViewState (as per your example page) is:/wEPDwUJMTgxMjAzNjcwD2QWAmYPZ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BmcfB2cfCQUsL21hc3RlcnBhZ2VzaXRlL29ubGluZV9zZXJ2aWNlcy9lYWxlcnRzLmFzcHgfAmdkZAITDw8WAh8EBQRIb21lZGQYAQULY3RsMDAkTWVudTEPD2QFBEhvbWVkXp6pLJa+v0aDYZ0Mw0FTTM5KeMs= You could help get rid of that by setting EnableViewState="false" for the controls that are on pages which you will not be posting back to the server.An approach that I take with a lot of sites is to use webcontrols (ascx files). If you build a web control for your navigation, you can include that webcontrol on any page that uses the navigation. Further, if those web controls are static HTML, (as far as I know) the server will compile those controls and serve them from cache rather than dynamically building them each time a page loads. This could help improve processing time on the server.EDIT: You can also improve file size (i.e. make it smaller) by getting rid of all the white space in your page. Rather than indenting each line with spaces or tabs, start each line on the left margin. Sure, it's a little bit harder to read the code, but each of those whitespace characters takes up a single byte. <ul> <li><a href="">Button 1</a></li> <li><a href="">Button 2</a></li> <li><a href="">Button 3</a></li> <li><a href="">more...</a></li> </ul> That code has 136 spaces used to indent the HTML. Each of those spaces is a single byte meaning that the following code is 136 bytes shorter: <ul><li><a href="">Button 1</a></li><li><a href="">Button 2</a></li><li><a href="">Button 3</a></li><li><a href="">more...</a></li></ul> Taken over an entire page, you can remove 4KB on a small page to 30KB on a larger one.
  10. jesh

    Loading external url

    If you are certain that the form on the other site is not going to change, maybe you could create a form on your own site which has the same input fields (with the same names and ids) and uses the same method and then set the action for that form to be the same URL that the other form uses for the action. Then, when the user submits the form, it gets submitted to that other server.If you are not certain that the form is not going to change, frames/iframes may be your only option.
  11. What if you created a table variable that would hold the IDs: DECLARE @IDs TABLE(id int) Then you could parse your @Param1 string one id at a time, cast them into ints and add them to the table variable. I'm still working on this step...Once you have your table variable filled with ids, you could run the query like so: SELECT * FROM myTable WHERE ID IN (SELECT id FROM @IDs) Maybe you know how to parse a string in a stored procedure. If I find out I'll post it for you.EDIT: I found this link: http://vyaskn.tripod.com/passing_arrays_to..._procedures.htmMethods 2 and 3 on that page show how they convert a comma separated values parameter into individual ints that they store in a table variable. Let me know if it works, ok?
  12. I typically only validate selects that I deem as required by checking to see if the selected index is greater than a default.If your select was: <select id="myselect"> <option value="-1">Select an Option</option> <option value="1">Value 1</option> <option value="2">Value 2</option></select> You could validate that like so: var select = document.getElementById("myselect");if(select.selectedIndex > 0){ // it validates} Or you can validate by value: var select = document.getElementById("myselect");if(select.options[select.selectedIndex].value != "-1"){ // it validates}
  13. You can create a javascript date for February 28, 2007 and another date for the current date. Then you could subtract the current date from the future date to get the number of milliseconds from now to that future date. Then you could divide that number by 86400000 (the number of milliseconds in a day) to get the number of days to the future date.I hope this helps!
  14. jesh

    Ajax Response

    The only options in the response are text (i.e. a string) or XML. Using text, your server side code could join an array into a delimited string and return that string to your page. Then your javascript could split that string back into an array, but you can't pass a javascript array as the return value.
  15. In your second code, you had an alert (commented out) that would tell you the id for "listitem" but you don't appear to ever be assigning a value to "listitem". Then your send data is defined as "dir=" + newListitem.id;What happens when you alert "newListitem.id" instead of "listitem.id"? Or, what if you, like the first code block, assigned the "newListitem.id" to "listitem.id" and then used "listitem.id" for the send data?
  16. First, I would definitely not recommend javascript/ajax for this since you must pass that authentication xml with each request. If you posted this with javascript, people would be able to look at that file to figure out the password you use to access this Web Service.Second, you can't use AJAX to send requests to domains other than the domain that served the page.Third, I don't know PHP well enough to help you much. In C# and .NET you'd use an HttpRequest or a WebClient to POST data to another server. Maybe you could post a question in the PHP forum asking how you POST data to another server without using a form.
  17. Excellent! Thanks guys.
  18. I have to perform some logic in a stored procedure based on the values in a particular table. I know that I can do this to assign some values to two variables: DECLARE @value1 intDECLARE @value2 intSET @value1 = (SELECT column1 FROM mytable WHERE id=5)SET @value2 = (SELECT column2 FROM mytable WHERE id=5) Does anyone know whether or not I can do the above with a single select statement rather than having to run two selects against the same table to fetch two different columns in the same row?DBMS is SQL Server 2005.
  19. str = str.replace(/\s/g, "");
  20. Well, now that you know that doGet runs, you should just be able to start plugging the code that you had in your previous posting into that doGet method.
  21. jesh

    Dynamic Links

    Or, check to see if the date is set in the URL (like the example from Kiwi). If it is set, then store that value in some $date variable. If it is not set, then set $date to today's date.Then use that $date in your WHERE clause.
  22. jesh

    Zip Code Look-up

    This page has a comma-delimited list of zip codes, states, and, I believe, cities. Perhaps you could import this data into your database:http://www.census.gov/geo/www/gazetteer/gazette.htmlAlternatively, you can purchase a database of ZipCode information here: http://www.zip-codes.com/Or, you might look into Web Services to see if anyone offers a free Web Service for ZipCode lookups.EDIT: PS, I believe there are literally tens of thousands rather than hundreds.
  23. What code do you already have?
  24. Do you have any idea where the error is occurring (i.e. the line number)?You build the URL like this: var url="deals.asp"url=url+"?mobID="+mobID+"&netID="+netID+"&sid="+Math.random() What happens when you type that resulting URL into the address bar of your browser rather than using AJAX. Does it load as you would expect?Does the alert in your stateChangedDeal function pop up with the contents of the responseText?Without any further info, my only suggestion at the moment is to use: xmlHttp.send(""); Rather than: xmlHttp.send(null)
  25. jesh

    AJAX Tutorial

    I don't know the answer to that question. However, I would get the HttpRequest object differently than what is explained here: http://www.w3schools.com/ajax/ajax_xmlhttprequest.aspTo insure that the XMLHttpRequest is used before the ActiveX stuff, I'd try to get the XMLHttpRequest before any of the ActiveX stuff, like so: var XMLHttp = null;if(window.XMLHttpRequest){ XMLHttp = new XMLHttpRequest();}else if(window.ActiveXObject){ try { XMLHttp = new ActiveXObject("Msxml2.XMLHTTP"); } catch(e) { try { XMLHttp = new ActiveXObject("Microsoft.XMLHTTP"); } catch(e) { } }} I would think that if IE7 supports the XMLHttpRequest, this would work in IE.
×
×
  • Create New...