Jump to content

LLLLLLL

Members
  • Posts

    306
  • Joined

  • Last visited

Posts posted by LLLLLLL

  1. I'm trying a basic CSS media query. I added these two lines to my file... they are essentially copied from another site, with the href being different and referring to actual files on my server.

     

    <link rel="stylesheet" type="text/css" media="screen and (max-width: 740px)" href="assets/css/style_m.css" />

    <link rel="stylesheet" type="text/css" media="screen and (min-width: 741px) and (max-width: 900px)" href="assets/css/style.css" />

     

    But this doesn't work for me at all. The result on my site is that the elements on the page act as if no CSS file is declared at all. Is there something more that I need to do?

  2. I have an HTML5 audio player that gets created dynamically. Elsewhere the variable is declared:

    var default_volume = 0.8;

     

    Then I set the volume for the player ...

    player.setAttribute( 'volume', default_volume );

     

    Debugging shows default_volume is 0.8, but once set, "volume" is changed to 1

     

    Why is there rounding? How can I make it maintain the value I chose?

  3. There are lots of form-validation discussions revolving around onsubmit versus onclick. This is not one of them, but it's related.

     

    I noticed something like this:

     

    <form method="post">
    ...
       <input type="submit" onclick="return validate_form()">
    </form>
    

     

    So there's no "onsubmit" validation for the form, but the button's onclick is calling the function instead. This isn't the recommended way to do this validation, so it is said, because someone can press "enter" in another input field of the form, thus bypassing the "onclick" event of the button.

     

    But that's where my question comes in....

    1) I am pressing enter in a text box

    2) The "validate_form()" function is getting called anyway!

     

    Why would that be? Is there now built-in logic to some browsers to do this? Any other reason?

     

    Chrome's call stack shows that the onclick handler initiated the call to the function, but I pressed enter in a text box. So why did that handler get called?  (Chrome, IE, all the browsers do this.)

     

  4. So, I understand if I add the following, that other domains can use the script via AJAX:

     

    <?php
    header("Access-Control-Allow-Origin: *");
    ...
    code that does something
    

     

    My question is: does this line have to be at the top of the file? Does it matter where this line is located?

     

    I was thinking of doing something that lets a user configure their software's "allowed" domains, so, something like this:

     

    <?php
    $urls = db::some_query_to_see_allowed_origins();
    
    if ( !empty( $urls ) )
        header("Access-Control-Allow-Origin: $urls");
    
    ...
    code that does something
    

     

    Would something like this work?  I don't know at what point the "cross-domain" errors occur, so I don't know where the header line needs to be.

     

  5. A customer's web page of their store (where credit card numbers are entered) is HTTPS. On my machine, and for several others, there are no content warnings; everything is HTTPS. For some users, the page shows that some content is insecure. How is this possible?

     

    I should note there is a backstretch jQuery script in use, but I've set the background to always be HTTPS, so it doesn't make too much sense that this is the culprit.

  6. The only additional information I have is that based on browser settings, a user might get "although this page is encrypted the information you have entered is to be sent over an unencrypted network."

     

    This still doesn't make sense. It is an HTTPS page with a relative URL. How can it be posting as HTTP? Ugh.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.