Jump to content

hammadtariq

Members
  • Posts

    19
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

hammadtariq's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I reverted the code because it was not working but quickly it was a javascript function: function loadingJava(){ document.write("appletcod-goes-here"); } window.onload = loadingJava; Thought it would work. I have other script tags on the pages as well and one of them appear consistenly, that is related to tabview component of YUI and it uses window.onload event as well. So, using onload is not a good idea, but I tested this on a page where there was no onload function already but that didnt worked either.
  2. Hello, I searched for it a lot but probably I am searching wrong strings. A Java applet is feeding live bits into my pages, java applet accesses the input fields on my page and places the information <input type="hidden" id="F1" value="Nothing Yet"> and then it calls a javascript functionon the page say LivePicker() and then it simply picks up a value var ClockVal = document.getElementById("F1").value; document.getElementById("ICSCLOCK").innerHTML = ClockVal; The problem I am facing is, this works fine but sometimes in firebug console it give errors like LivePicker is not defined, while LivePicker would be working perfectly fine on the page while sometimes it will give F1 is not defined, while my clock would be working fine. All of these errors appear at page load. Java applet places the data sequentially, it first place the data and then calls the js function to process it. That works perfectly fine on test pages with minimum HTML and JS but when I integrate it to my application, which uses a lot of components from YUI and a lot of my own JS code (which is now minified obviously), it give these errors. One thing I would like to add, before minification, these errors were a lot likely but after minification of JS and CSS, the page load time is reduced to half and the appearence of these errors are reduced to half as well. I am suspecting this is due to, on page load, applet tries to manipulate the DOM which is not ready yet. Is there anything, which could stop the applet to wait until the DOM is fully loaded? I tried window.onload and onDOMReady function of YUI, they seem to make no effect at all. Can any one help?
  3. Hello guys, I have this rather classic problem when interacting with databases of handling single quotes and special characters. In PHP I am escaping the single quote with another single quote and regex syntax characters with preg_quote and they are working like a pro. The problem is with javascript, there are some points in my scripts where I am directly passing the database variables at the runtime into the javascript to build it up and that's where it is breaking up. Following is an example: var href = "region_view.php?min_row=1&max_row=25&reg_name=^*&new''region' blah£"&order_by=reg_name asc"; Note the reg_name variable, which is giving me an error in firebug console that invalid assignment left-hand side. First question is, is there any function like eval or something which can take care of these single double quotes by default? Second question is, these type of things are done all along the application. Going back through each javascript line and taking care of single and double quotes will be a hard task to do. Is there something like global which can sort this problem. Thanks,
  4. Thanks vineet for your help. I have introduced in <option> Tirana</option> and that somehow have fixed the thing. Thanks
  5. Hello, Thanks Vineet, this sounds promissing but optgroup is lacking the value attribute. Infact I have the region's drop down which goes like this: Albania Tirana United Kingdom London Pakistan India United States New York In this scenario user can also select United Kingdom for example and I dont want United Kingdom to be repeated twice. Is there any solution for it? Thanks
  6. Hello, I have checked this in IE8 and its compatible mode, in firefox this code is working fine but in IE its not indenting as expected. The code is below: <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <title>blah blah</title> </head> <body> <select> <option style="padding-left: 0px;">Blah</option> <option style="padding-left: 5px;">Blah</option> <option style="padding-left: 10px;">Blah</option> <option style="padding-left: 0px;">Blah</option> <option style="padding-left: 5px;">Blah</option> </select> </body> </html> Please help!
  7. Sorry it is a problem with YUI (Yahoo User Interface) library. I made a test page without using YUI and now the drop down is not cutting the text but extending the drop down width the to the highest width option. I want it just to look like as it works in Fire Fox. Here is the test page: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html dir="ltr" lang="en"> <body> <h1>Enhancing the select element</h1> <form action="#"> <select class="turnintodropdown" name="test" id="test"> <option value="56">56K dial-up</option> <option value="isdn">ISDN dial-up56K dial-up56K dial-up56K dial-updial-up56K dial-updial-up56K dial-updial-up56K dial-updial-up56K dial-updial-up56K dial-up</option> <option value="DSL">DSL</option> <option value="cable">Cable Modem</option> <option value="T1">T1</option> </select> </p> <p> <label for="media">Media</label> <select class="turnintodropdown" name="media" id="media"> <option value="cd">CD</option> <option value="vinyl">vinyl</option> <option value="dvd">DVD</option> <option value="vcd">Video CD</option> </select> </p> <p><input type="submit" value="send" /></p> </form> </body> </html> If you view this example in firefox and IE, you will get to know what I am asking for. Any ideas?
  8. Hello, I am having cross browser usability issue with select drop downs, you know in firefox if there is any option which is quiet long, firefox will automatically adjust the drop down width with the option of highest width, while in IE, it remains as much as you tell it to remain using width style property. I want the IE to behave like firefox too, that forexample, select drop down stays for about 100px width but on click, there shouldn't be any text cut-out behind scroll bar. Is there any javascript solution for it? Thanks
  9. Hello Guys, I have a task in hand in which I am getting strings which are in fact subjects of emails and they are like "This should be done! 568975/12/tinup" "456789 is your reference" "I am in 456789 area" All I need is to take out consecutive six matching numbers and that will be my reference number. Reference number is always in six digits and I need to take out any occurance of six digit numbers and stripping out everything else. I considered using strspn() but thats not working I guess that is not for search like this and I am really bad in using preg_match, can any one help me please?
  10. Hello, I am just wondering if there is any way around in php which can facilitate us to open up an ISO image file (CD Image) and access data in it?
  11. hello,       I have a problem, hope you people can help me out. Suppose I have a file here home>include>anotherfolder>file.php now in file.php I want to include a file which is here: home>include and in file.php I want to set the header location to: home>somefile.php How can I do that? the problem is how can I refer the files which are stored in above directories. I am using IIS in home and Apache on server.
  12. [quote author=HuggieBear link=topic=121525.msg500192#msg500192 date=1168301404] I see what you mean, that's certainly why it's not uploading it.  I think I'll look into this a bit further for you tomorrow when I get to work, as I had a similar problem myself. Regards Huggie [/quote] hmm well thanx Huggie in advance.. as far as my perception is concerned I think IIS or windows itself is not recognizing this format as this is not so common, I have seen list of support file formats by IIS, refer to my first post, this format has to be added in IIS by going in Control Panel>Administrative Tools>IIS>Default Website>Properties>HTTP Headers>File Types. i have added there but its still not working. hope that you will find some solution for it as Apache don't seem to work with it either!
  13. [quote author=HuggieBear link=topic=121525.msg499939#msg499939 date=1168283696] If you echo out $_FILES['upload']['type'] have you definitely copied down the file type correctly? Regards Huggie [/quote] thanx for the hint Huggie but there comes another problem, on echo it is returning application/octet-stream which is quite ambiguise as I have seen the list which have this mime type and that goes on..means this is same mime type for exe, doc, mmf, lhz, lha etc. while i m intending to allow only mmf... is there any solution? how to do it? or why it is behaving like that?
  14. well there is no problem with upload procedure as it is quite fairly uploading other extensions like mp3 and amr. however below is the array where i store mime types of extensions: $upload_types = array(  'audio/amr' => 'amr', 'audio/wav' => 'wav', 'audio/mpeg' => 'mp3', 'audio/mpeg3' => 'mp3', 'audio/x-mpeg-3' => 'mp3', 'audio/x-wav' => 'wav', 'audio/midi' => 'midi', 'audio/x-mid' => 'mid', 'application/x-smaf' => 'mmf', 'application/vnd.smaf' => 'mmf', ); Here I get the type:         $type=$_FILES["upload"]["type"]; and here I check the whether the uploaded types is in array or not: if(array_key_exists($type, $upload_types)) {                           } All other works fine, problem is only with mmf extension.
×
×
  • 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.