when people click the "Click/tap here to copy code" on the site it doesn't actually copy the code
I made this site the other day - https://trx.promo/ and the issue i am having is when people click the "Click/tap here to copy code" on the site it doesn't actually copy the code and yes i added it all right to the html file... ofcourse unless you can find a mistake in the page source code. I am using a built in website builder on a site called hostinger.com which is "Zyro website builder" incase someone asks. Anyways if someone can help me with a solution that would be great as i have been spending way to much time trying to find a solution.
See also questions close to this topic
-
Adding a constructor to an injected Project Class
I'm trying to add a constructor, which I call
ctor
, toProject
, so I can add to it some properties when it's instantiated.Here's the (absolutely ghastly) hack I'm using on
Item
to make this tick:const canvas = document.querySelector('canvas') paper.setup(canvas) paper.Item.inject({ ctor: function(args) { console.log('Item constructed!') } }) // All Items are supposed to call `_initialize` so we "hook" there. const Item_initialize = paper.Item.prototype._initialize const Item_ctor = paper.Item.prototype.ctor paper.Item.prototype._initialize = function(...args) { const initializer = Item_initialize.apply(this, args) if (Item_ctor) Item_ctor.apply(this) return initializer } const path = new paper.Path.Line({ strokeColor: 'black', strokeWidth: 5, from: 100, to: 50 })
<script src="https://cdnjs.cloudflare.com/ajax/libs/paper.js/0.12.0/paper-core.js"></script> <canvas></canvas>
Unfortunately the above trick doesn't work on
Project
:const canvas = document.querySelector('canvas') paper.setup(canvas) paper.Project.inject({ ctor: function(args) { // Not called console.log('Project constructed!') } }) const Project_initialize = paper.Project.prototype._initialize const Project_ctor = paper.Project.prototype.ctor paper.Project.prototype._initialize = function(...args) { const initializer = Project_initialize.apply(this, args) if (Project_ctor) Project_ctor.apply(this) return initializer } const project = new paper.Project(canvas)
<script src="https://cdnjs.cloudflare.com/ajax/libs/paper.js/0.12.0/paper-core.js"></script> <canvas></canvas>
What am I missing here?
-
How to delete div and all element inside div? Javascript, html, css
I have a function that clears the entire div and it disappears but still appears in the inspect (html). This is a real problem because we have this input type field on the email and I got this empty data in email. I only want when this value is not chosen to completely remove me from html and inspect. Look at my code and try to catch the error. The most important things in the whole code that you need to pay attention are
onchange="checkSelected()"
in html and first script tag which manipulate with that. It should simply become a display none but it still stands there.<div class="modal fade" id="montageModal" tabindex="-1" role="dialog"> <div class="modal-dialog" role="document"> <div class="modal-content" style="display: flex;"> <div class="modal-body"> <form id="schedule_form" class="clearfix" action="index.php?route=api/reifenmontage" method="post"> <div class="container-fluid"> <div class="step_1" > <h3 class="modal-title">Reifenmontage Termin buchen </h3> <div class="row termin_row"> <div class="col-xs-12 col-sm-4"> <div class="row"> <label>Pneu-Typ</label> </div> </div> <div class="col-xs-12 col-sm-6"> <div class="row"> <select onchange="checkSelected()" class="form-control" name="pneu" id="pneu"> <option value="Motorrad">Motorrad</option> <option value="Auto">Auto</option> </select> </div> </div> </div> <div id="additionalRow" class="row termin_row" > <div id="reifenmontage-input" class="row termin_row"> <div class="col-xs-12 col-sm-4"> <div class="row"> <label>Mark und model</label> </div> </div> <div class="col-xs-12 col-sm-4"> <div class="row"> <select name="marka" class="form-control" id="button-getdata"> </select> </div> </div> <div class="col-xs-12 col-sm-4"> <div class="row"> <select name="model" class="form-control" id="result" > </select> </div> </div> </div> </div> <div class="row termin_row"> <div class="col-sm-4 col-xs-12"> <div class="row"><label>2. Terminvorschlag</label></div> </div> <div class="col-sm-4 col-xs-6"> <div class="row"> <div class="input-group date" id="date-2" data-termin="1"> <input type='text' class="form-control" name="date[1]" /> <span class="input-group-addon">um</span> </div> </div> </div> <div class="col-sm-4 col-xs-6"> <div class="row"> <div class="input-group time" id="time-2" data-termin="1"> <input type='text' class="form-control" name="time[1]" /> <span class="input-group-addon">Uhr</span> </div> </div> </div> </div> <div class="row"> <div class="checkbox"> <label> <input type="checkbox" name="accept" id="accept"> Ich akzeptiere die <a href="teilnahmebedingungen" target="_blank">Teilnahmebedingungen</a> </label> </div> </div> <div class="row text-center"> <button type="button" class="btn btn-primary btn-lg btn-submit" id="next_step" disabled="disabled">Anfrage senden</button> </div> </div> <div class="step_2"> <h3 class="modal-title">Your contact info</h3> <div class=""> <div class="form-group clearfix"> <input type="text" name="name" value="<?= $user['name'] ?>" placeholder="Name and Lastname" class="form-control name text" required /> </div> <div class="form-group clearfix"> <input type="text" name="phone" value="<?= $user['phone'] ?>" placeholder="Phone" class="form-control phone text" required /> </div> <div class="form-group clearfix"> <input type="email" name="email" value="<?= $user['email'] ?>" placeholder="Email" class="form-control email text" required /> </div> <div class="text-center"> <button type="submit" id="submit" class="btn btn-default btn-lg btn-submit" >Suchen</button> </div> </div> </div> </div> </form> </div> <div class="modal-footer"> <button type="button" class="close" data-dismiss="modal" aria-label="Close">SCHLIESSEN</button> </div> </div> </div> </div>
and my script tag
<script type="text/javascript"> let selectItem = document.getElementById('pneu'); let additionalRow = document.getElementById('additionalRow'); function checkSelected() { if (selectItem.selectedIndex == "1") { additionalRow.style.display = 'none'; } else { additionalRow.style.display = 'block'; } } </script> <script type="text/javascript"> $('#button-getdata').on('change', function() { $.ajax({ url: 'index.php?route=api/reifenmontage/get_marka_data', type: 'post', data: $('#reifenmontage-input select'), dataType: 'json', beforeSend: function() { }, success: function(json) { if (json['success']) { $("#result").empty(); for (i in json['success']) { var element = json['success'][i]; var o = new Option(element['model'], element['model']); $("#result").append(o); html = "\t<option value=\""+ element['model'] + "\">" + element['model'] + "</option>\n"; $("#result").append(o); } // document.getElementById("schedule_form").reset(); } } }); }); </script> <script type="text/javascript"> $.ajax({ url: 'index.php?route=api/reifenmontage/mark', context: document.body, success: function(data) { const selectControl = $('#button-getdata'); selectControl.html(data.map(ExtractData).join('')); } }); function ExtractData(item) { return ` <option value="${item.value}">${item.label}</option>`; } </script>
-
How to change the color of words in jumbotron using the reference $jumbotron?
I am learning web design and js .On my webpage, I define the default color is black in jumbotron h2.
.jumbotron h2{ text-align: center; color:black; }
define reference var $jumbotron = $('.jumbotron h2'); while running, I use
$jumbotron.html('hellow world'); ......
to display some words and I want to change its color but I do not know how to set new color while running, how to get the color value and assign a new value for my variable $jumbotron? I have tried$jumbotron.color =
or$jumbotron.color('')
but they are wrong. I have not found any useful answers with google. -
Moving cell values and deleting rows
I need to move some data but my current code (started with vba some weeks, so please be benevolent :) ) is super-slow.
Can you give me some advices?
I want to to from this...
...to this...
...and then this.
Do While Not Listado.Cells(rowquery, colquery) = "" Listado.Cells(rowquery, colquery).Offset(0, 2) = Listado.Cells(rowquery, colquery).Offset(1, 1) Listado.Cells(rowquery, colquery).Offset(0, 3) = Listado.Cells(rowquery, colquery).Offset(2, 1) Listado.Cells(rowquery, colquery).Offset(1, 1).Clear Listado.Cells(rowquery, colquery).Offset(2, 1).Clear rowquery = rowquery + 3 Loop
Thanks!
-
Python, copy file with creation
I'm writing script on Python for copy cron config. I need to copy my file to
/etc/cron.d/
, and if destination file isn't exist it must be created. I found solution, but it doesn't provide missing file, here it is:from shutil import copyfile def index(): src = "/opt/stat/stat_cron" dst = "/etc/cron.d/stat_cron" copyfile(src, dst) if __name__ == "__main__": index()
I get exception
"FileNotFoundError: [Errno 2] No such file or directory: '/etc/cron.d/stat_cron'"
Please, tell me correct solution.
-
Using a batch script to prevent files being copy to a drive
There are many ways to copy files to a drive through a batch script. But, what I want is to prevent other processes from copying files into a drive. This might look like malicious, but I'm doing this to stop such malicious processes to copy anything to drives.
Things I've tried.
- Trying to stop copy service.
- Trying to kill copy process.
But in each case, I couldn't stop it before copy( Copy some files before I stop it). And I was using polling to see if there is a process/Service copying.
-
How to get clipboard history in Android
I need to get the full history of the user on Android for image attachment.
I tried that on Android 8.1.0(API27).
private Context o_context = null; private ClipboardManager o_clipboardManager = null; private ContentResolver o_contentResolver = null; private ClipData o_clipData = null; private void getClipboardHistory() { o_clipboardManager = (ClipboardManager) getSystemService(Context.CLIPBOARD_SERVICE); o_contentResolver = getContentResolver(); o_clipData = o_clipboardManager.getPrimaryClip(); for(int i = 0; i < o_clipData.getItemCount(); i++){ ClipData.Item lo_item = o_clipData.getItemAt(i); String ls_text = null; String ls_title = null; Uri lo_uri = lo_item.getUri(); } }
I wanted to bring all the clipboards. but
o_clipData
has only one text item in this codePerhaps that is the last data copied.
left text is clipboard and right text is removeAll
-
React Native - Listener for change in clipboard
Is there a way to add a listener for a change in clipboard data in React Native? Basically depending on whether the user has copied something in their clipboard, regardless of whether inside the app or with the app in the background, I want to perform some methods.
-
How can two visually identical bits of text be different to the clipboard?
I have a sublime document with two identical file paths (2 seperate lines), if I copy one my app functionality works, if I copy the other it does not.
When I select one line and do cmd + d you would expect sublime to highlight both lines, as per normal functionality. It does not. This is also true in VC code, so something is different about these two lines.
I have tried myData.toString() I tried JSON.parse but it didn't go well I couldn't figure it out
Here at the offending lines.
/Volumes/Macintosh HD/Archive/Work/AE_Scripting/Resources/CEP-Resources-master/CEP_8.x/Documentation -Works /Volumes/Macintosh HD/Archive/Work/AE_Scripting/Resources/CEP-Resources-master/CEP_8.x/Documentation
Upon uploading an example file for this post I have now some new information, as you can see here
http://gravitystaging.com/uploadarea/test/examplefile.txt
Both lines now appear as
/Volumes/Macintosh HD/Archive/Work/AE_Scripting/â¨Resourcesâ©/â¨CEP-Resources-masterâ©/â¨CEP_8.xâ©/â¨Documentation -Works /Volumes/Macintosh HD/Archive/Work/AE_Scripting/Resources/CEP-Resources-master/CEP_8.x/Documentation
Although in any editor they look normal and identical. So how can I process this string to remove this.
-
Cutting a region on one worksheet and pasting to another doesn't work. But copy does. Why?
I have been struggling with this problem for awhile now.
I've written a VBA routine that is supposed to find a region on one worksheet, then cut and paste it to another worksheet. If I run the following code it doesn't work:
' This does not work DSheet.Range(SummaryDataAddr, DSheet.Cells.SpecialCells(xlLastCell)).Cut PSheet.Range(SummaryDataLocation).PasteSpecial Paste:=xlPasteValues
But if I change the code to copy the region from the first worksheet, paste it to the second worksheet, then go back to the first worksheet and explicitly delete the region, it works.
' But this does work. Why? DSheet.Range(SummaryDataAddr, DSheet.Cells.SpecialCells(xlLastCell)).Copy PSheet.Range(SummaryDataLocation).PasteSpecial Paste:=xlPasteValues DSheet.Range(SummaryDataAddr, DSheet.Cells.SpecialCells(xlLastCell)).Delete
Has anyone seen this kind of problem before? Is there a way to use the cut function and get it all to work?
To access a the spreadsheet with the VBA code in it go here: https://www.dropbox.com/s/satv6z95tlqw7lr/CutBug.xlsm?dl=0
The routine is called "CreateDLDataPivot" (it's a pared down version of a larger program I'm working on).
Thanks for any help!
-
How do I use a macro to copy and paste in the same row if a condition is met?
I'm still new to VBA and I'm running a report and the way I receive it a few of the rows have an additional column of data that I don't need but it messes up formatting for those entries. For example, in Column B I have the profiles listed for everyone but for these few entries I have a number or something else (it isn't consistent for each one). But for those same entries I have a "Y" in Column H that none of the other entries have. I'm trying to search through the report for the "Y" in Column H and then copy columns C through H and paste it in Column B so that all the data aligns. Out of a couple hundred entries there might be 6-7 that need to be moved. Here is some sample data that I hope shows the issue. BTHOMAS Column B is the problem in this example.
A | B | C | D | E | F | G | H -------------------------------------------------------------------------------------------- ID | PROFILE | STATUS | DATE ADDED | LAST USED | EXP DATE | P/W EXP | SBUTLER | NOM | ENABLED | 9/9/2014 | 10/5/2018 | 00/00/00 | N | WPERRY | NOM | ENABLED | 10/29/2014 | 10/4/2018 | 00/00/00 | N | BTHOMAS | 1234 | NOM | ENABLED | 2/1/2017 | 9/28/2018 | 00/00/00 | Y
I've done a lot of research on copy and paste macros, but everything I have found is either a single cell or the entire row and they paste it to another sheet. I just want to copy and paste in the same row. Here is the code I have so far, unfortunately it moves every column.
Sub MoveColumns() LR = Cells(Rows.Count, "B").End(xlUp).Row a = Worksheets("Sheet1").Cells(Rows.Count, 1).End(xlUp).Row For i = 2 To a If Worksheets("Sheet1").Cells(i, 8).Value = "Y" Then Range("C:H").copy Range("B:G") End If Next End Sub
The expected result is for the report to be aligned like in the example below. There is data in columns I through J so I can only copy columns C through H. Thanks for your time.
A | B | C | D | E | F | G | H -------------------------------------------------------------------------------------------- ID | PROFILE | STATUS | DATE ADDED | LAST USED | EXP DATE | P/W EXP | SBUTLER | NOM | ENABLED | 9/9/2014 | 10/5/2018 | 00/00/00 | N | WPERRY | NOM | ENABLED | 10/29/2014 | 10/4/2018 | 00/00/00 | N | BTHOMAS | NOM | ENABLED | 2/1/2017 | 9/28/2018 | 00/00/00 | Y
-
How can I copy thread data to an array before terminating the thread?
I am attempting to copy thread data in C from within a method which references the thread's struct using a pointer to an array of the struct type.
I attempted to use the "&" symbol to get the struct data, but received a make error in doing so. I would like to copy the entire struct's data before the thread, which is of the struct's type, is terminated.
Person queue[300]; Person statsArray[300]; // the queue contains Person structs that have been given data already // within another method, prior to calling Leave(). typedef struct { struct timeval startChange; struct timeval endChange; struct timeval arrive; int id; int changingTime; int storeTime; int returning; int numVisits; int type; int queuePos; } Person; void Leave(int queuePosition) { Person *aPerson = &queue[queuePosition]; statsArray[statsArrayIndex] = &aPerson; statsArrayIndex++; }
When compiling, I get the error of "incompatible types when assigning to type 'Person {aka struct }' from type 'Person ** {aka struct **}'
-
How to remove duplicates automatically in excel?
I have two files, File A and File B.
- I copied File A, Column A's data into File B, Column A
- I want to remove Duplicate Values from Column A when I paste into File B (without using VBA would be much better).
Thank you
-
copying a dict leaving out one (key, val) pair
In Python 3, how do I copy a dictionary leaving out just one element? Data sharing among the two dicts is fine for me. Currently I have this code in mind:
def copy_leaving_out(dictionary, key): return {k: v for k, v in dictionary if k != key}
Is there a better way to achieve this?
EDIT: I forgot to use
dictionary.items()
instead ofdictionary
, please consider the following code instead of the previous one:def copy_leaving_out(dictionary, key): return {k: v for k, v in dictionary.items() if k != key}