
Jeisson
Members-
Posts
40 -
Joined
-
Last visited
Jeisson's Achievements

Member (2/5)
0
Reputation
-
I have an iframe in a html or php site (tried both) and it works fine on Firefox and my mobile browsers. But Chrome behaves badly. The iframed php page contains a form and when I send it the whole iframe disapears. But it reapears when "painting it with my mouse". no cliks needed. just some mouseover/hovering. The whole iframe don't appear at once but small part of it. Therefor the "painting expirience". It is annoying because the visitor don't kmow to do this. Sorry, but i dont know how to explain this any better. the form is a domain lookup form (whois).
-
I have a php file in a iframe from where I take a form result to the parent with following jquery code. In the example there is both appendTo to a <p> and an input element. Anyway works fine on desktop browsers as far as I have tested, but not on my phone . <script> $('#order').click(function() { var free = $('#iframeid').contents().find('#free').text(); $("<span>"+free+" </span>").appendTo("#g"); $('.g').val($('.g').val() + vapaa); }); </script> <button id="order">'order domain</button> <p> <div id="wrap"> <p id="g"></p><p> <input type="text" class="g" id="inputbox" name="input" placeholder="www.example.com" width="100px"/> </div> Any other solutions? I managed only to make these. Preferable I use input text element. The span was just for a test. Thanks.
-
Ok now I realize. I thought in my case they would be valid but that is not the case. Need to re-think the whole thing now. Something like decoding each file and then getting what I am lookin for and store that as new json. Whole merging and concatening I think I do not need..
-
yeah I will see. My json files are not ready yet. So I will work on them when I have the code that does something with them. Iḿ just such a noob. May I ask why first code works json_decode($complete_json,true); var_dump($complete_json); while this not. $content = json_decode($complete_json,true); var_dump($content); I just don see the logic always
-
I don't yet have any better approach I'm just thinking out loud. I will need to try and test. this was first step. Are you suggesting it would be safe way to decode everything then array_merge and encode this to json?
-
thank you I will continue from here. The json files have all same structure so I thought I could merge them to one. But if that will not work I will try to get a specific key from each files directly. Maybe something like that would be better anyway.
-
Hello I have several json files in one directory. i would like to merge them in to one. I did something like this <?php foreach (glob("../json/*.json") as $filename) { echo basename($filename) . "\n"; } $res1 = file_get_contents($filename); echo $res1; ?> But it echoes only the last (the first echo is to view all files which is not important here) Then I tried many versions of foreach inside foreach with no success. Like this: <?php foreach (glob("../json/*.json") as $filename) { foreach (file_get_contents($filename) as $a) { } } echo $a; ?> So I appreciate a little help here, thank you.
-
Hello I would like to populate the select onload. or document ready with jquery I dont see why not working' <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>xml to select</title> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script> <script> $(document).ready(function() { $.ajax({ type: "GET", url: "test.xml", dataType: "xml", success: function(xml) { $("#myDiv").append("<select id='mySelect'>"); $(xml).find('value').each(function(){ var a = $(this).text(); $("#mySelect").append("<option class='nice' value='" + a + "'>" + a + "</option>"); }); $("#myDiv").append("</select>"); } }); }</script> </head> <body> <div id="myDiv"></div> </body> </html> Thank you for your advice.
-
ok. maybe I should directly do it that way then. i just thought i could "manually" do like I was asking first. I know how to get json to array. havent done before select populsting or what should i call it..
-
I get that. But wont work in my case. I need the value to be dynamical. I will get it from a json or similar. So Now I thought to get it from an Array. Afterwards I parse the json to that specific array.
-
Hello there friends I have an select box and I would like to define the alue of the selects with array. Like this: var price_list= new Array(); price_list["-"]=0; price_list["bronze"]=5; price_list["silver"]=10; price_list["gold"]=15; The I have a Selectbox where <form action="" id="metal" onsubmit="return false;" <select id="a" name="metals" class="form-select"> <option value="-">-</option> <option value="bronze">bronze</option> <option value="silver">silver</option> <option value="gold">gold</option> </select> And performig calculations with following script (that works fine if the value is directly in select). And obviously there is another select (#b) but that is just numbers so I didn show it here. $(document).ready(function() { function compute() { var a = $('#metals').val(); var b = $('#b').val(); var total = a * b * 1.22; $('#result').text(total); } $('#metals, #b').change(compute); }); I just get returned NaN If you have an answer then please hit
-
I solved it by changing echo to print_r and skipping the ajax for now and wrote php file_get_contents snippet instead I suspect there is something in the ('up') and ('down') that needs to be printed properly. I use (\'up\') and works fine wit php but not ajax
- 4 replies
-
- file_put_contents
- ob_get_contents
-
(and 1 more)
Tagged with:
-
Yes sorry I should have had that. I try to show essential code. //first some html like this <div id="scrollable-v1" class="scrollable"> <div class="belt"> <?php //then here are some api stuff //echoing and parsing and echoing like below shortened foreach ( $es as $it){ echo '<li>'; echo '[<all kind>]; foreach ( $ve as $ti){ echo 'a lot if text and stuff like that'; } } ?> </div> </div> <div class="skroll"> <img src="up.png" onMousedown="scrollv1.scrollContent('up')" onMouseup="scrollv1.stopScroll()" class="up"> <img src="dwn.png" onMousedown="scrollv1.scrollContent('down')" onMouseup="scrollv1.stopScroll()" class="dwn"> </div> code up works if I run in browser copypaste the output and save as a txt file. So I tried to do this saving with php. Like this here down //auto txt file code <?php // here are some api stuff //echoing and parsing and echoing like below shortened echo ' <div id="scrollable-v1" class="scrollable"> <div class="belt">'; ob_start(); //this is different from upper foreach ( $es as $it){ echo '<li>'; echo '[<all kind>]; foreach ( $ve as $ti){ echo 'a lot if text and tuff like that'; } } echo ' </div> </div> <div class="skrollit"> <img src="up.png" onMousedown="scrollv1.scrollContent(\'up\')" onMouseup="scrollv1.stopScroll()" class="up"> <img src="dwn.png" onMousedown="scrollv1.scrollContent(\'down\')" onMouseup="scrollv1.stopScroll()" class="dwn"> </div>'; $content = ob_get_contents(); file_put_contents('output.txt', "\xEF\xBB\xBF". $content); ?> Sorry if my shortening made it a mess. anyway diff services find no difference. nor do I. Started to think maybe it saves in other format? The txt file is used in jquery ajax load wordpress
- 4 replies
-
- file_put_contents
- ob_get_contents
-
(and 1 more)
Tagged with:
-
Hi When I have a file that echoes some stuff and I press view source and copy paste the source and manually makes this to a .txt file Something different happening somewhere comapred to if I have ob_start() //before the content ob_get_contents and file_put_contents //after to make the text file. I' do get a text file. It looks the same. the content is the same as my manually made. But when I load it with ajax in to my div only the manually made is scrollable. the scroll is made with .js What is going on here?
- 4 replies
-
- file_put_contents
- ob_get_contents
-
(and 1 more)
Tagged with: